Skip to content

Commit

Permalink
Auto Yes by Ctrl+C on Terminate batch job (Y/N)? on Windows
Browse files Browse the repository at this point in the history
Merge pull request #450 from o-sdn-o/vt-input-mode
  • Loading branch information
o-sdn-o authored Oct 28, 2023
2 parents a8dc763 + e545938 commit 70ef8f8
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 13 deletions.
5 changes: 1 addition & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@ Besides windowed mode, vtm can operate as a standalone terminal emulator inside
- Unlimited scrollback*
- Unwrapped-text option
- Horizontal scrolling
- Selected-text copy encoding:
- RTF file format
- HTML code
- ANSI escape sequences
- Rich text copy

Basicly, it allows users to use a huge scrollback buffer with text wrapping disabled, taking advantage of horizontal scrolling within whatever text console they happen to use.

Expand Down
2 changes: 1 addition & 1 deletion src/netxs/desktopio/application.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace netxs::app

namespace netxs::app::shared
{
static const auto version = "v0.9.12";
static const auto version = "v0.9.13";
static const auto desktopio = "desktopio";
static const auto logsuffix = "_log";
static const auto usr_config = "~/.config/vtm/settings.xml";
Expand Down
36 changes: 30 additions & 6 deletions src/netxs/desktopio/consrv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1106,6 +1106,22 @@ struct impl : consrv
template<class L>
auto readline(L& lock, bool& cancel, bool utf16, bool EOFon, ui32 stops, text& nameview)
{
static constexpr auto noalias = "<noalias>"sv;

if (nameview == noalias && server.inpmod & nt::console::inmode::echo)
{
lock.unlock();
if constexpr (isreal())
{
server.uiterm.update([&]
{
auto& term = server.uiterm;
term.ondata("(Ctrl+C to Yes) ");
});
}
lock.lock();
}

//todo bracketed paste support
// save server.uiterm.bpmode
// server.uiterm.bpmode = true;
Expand Down Expand Up @@ -1255,12 +1271,20 @@ struct impl : consrv
else if (c == '\t') { burn(); hist.save(line); line.insert(" ", mode); }
else if (c == 'C' - '@')
{
hist.save(line);
cooked.ustr = "\n";
done = true;
crlf = 2;
line.insert(cell{}.c0_to_txt(c), mode);
if (n == 0) pops++;
if (nameview == noalias)
{
line = "y";
cook(c, 1);
}
else
{
hist.save(line);
cooked.ustr = "\n";
done = true;
crlf = 2;
line.insert(cell{}.c0_to_txt(c), mode);
if (n == 0) pops++;
}
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions src/netxs/desktopio/system.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4182,15 +4182,15 @@ namespace netxs::os
check(changed, m.doubled, !!(r.Event.MouseEvent.dwEventFlags & DOUBLE_CLICK));
check(changed, m.wheeled, !!(r.Event.MouseEvent.dwEventFlags & MOUSE_WHEELED));
check(changed, m.hzwheel, !!(r.Event.MouseEvent.dwEventFlags & MOUSE_HWHEELED));
check(changed, m.wheeldt, static_cast<int16_t>((0xFFFF0000 & r.Event.MouseEvent.dwButtonState) >> 16)); // dwButtonState too large when mouse scrolls
check(changed, m.wheeldt, static_cast<si16>((0xFFFF0000 & r.Event.MouseEvent.dwButtonState) >> 16)); // dwButtonState too large when mouse scrolls
if (!(dtvt::vtmode & ui::console::nt16 && m.wheeldt)) // Skip the mouse coord update when wheeling on win7/8 (broken coords).
{
check(changed, m.coordxy, twod{ r.Event.MouseEvent.dwMousePosition.X, r.Event.MouseEvent.dwMousePosition.Y });
}
if (changed || m.wheeled || m.hzwheel) // Don't fire the same state (conhost fires the same events every second).
{
m.changed++;
mouse(m); // Fire mouse event to update kb modifiers.
mouse(m);
}
}
else if (r.EventType == WINDOW_BUFFER_SIZE_EVENT)
Expand Down

0 comments on commit 70ef8f8

Please sign in to comment.