Handle Ctrl+Z key later in the terminal input stack
The previous handling code was at a pretty random location and broke terminals that could send <c-z> encoded in a non pure ascii way. See #4238
This commit is contained in:
parent
4fd0fc3d80
commit
c68f85659f
|
@ -333,7 +333,12 @@ NCursesUI::NCursesUI()
|
||||||
return;
|
return;
|
||||||
|
|
||||||
while (auto key = get_next_key())
|
while (auto key = get_next_key())
|
||||||
m_on_key(*key);
|
{
|
||||||
|
if (key == ctrl('z'))
|
||||||
|
kill(0, SIGTSTP); // We suspend at this line
|
||||||
|
else
|
||||||
|
m_on_key(*key);
|
||||||
|
}
|
||||||
}},
|
}},
|
||||||
m_assistant(assistant_clippy)
|
m_assistant(assistant_clippy)
|
||||||
{
|
{
|
||||||
|
@ -640,11 +645,6 @@ Optional<Key> NCursesUI::get_next_key()
|
||||||
auto parse_key = [&convert](unsigned char c) -> Key {
|
auto parse_key = [&convert](unsigned char c) -> Key {
|
||||||
if (Codepoint cp = convert(c); cp > 255)
|
if (Codepoint cp = convert(c); cp > 255)
|
||||||
return Key{cp};
|
return Key{cp};
|
||||||
if (c == control('z'))
|
|
||||||
{
|
|
||||||
kill(0, SIGTSTP); // We suspend at this line
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
// Special case: you can type NUL with Ctrl-2 or Ctrl-Shift-2 or
|
// Special case: you can type NUL with Ctrl-2 or Ctrl-Shift-2 or
|
||||||
// Ctrl-Backtick, but the most straightforward way is Ctrl-Space.
|
// Ctrl-Backtick, but the most straightforward way is Ctrl-Space.
|
||||||
if (c == 0)
|
if (c == 0)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user