summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Fonseca <jonas.fonseca@gmail.com>2017-07-14 17:10:22 -0400
committerJonas Fonseca <jonas.fonseca@gmail.com>2017-07-14 17:10:22 -0400
commit12ed3a709dc576ecc2da0b980f785e9d3b363131 (patch)
tree64e98d869d7d3ac226dbf414b783d732eb2ac45c
parent2f55f1dd0635c99ebc9d5640b149239e52e0c26d (diff)
Fix #232: Do not generate any input when handling Ctrl-Z
Move the special case of Ctrl-Z introduced in 167d59ed1474e10ec3310fe7aa77314247332954 so no input is generated by get_input.
-rw-r--r--NEWS.adoc1
-rw-r--r--src/display.c6
2 files changed, 4 insertions, 3 deletions
diff --git a/NEWS.adoc b/NEWS.adoc
index 8c797c34..7b511427 100644
--- a/NEWS.adoc
+++ b/NEWS.adoc
@@ -43,6 +43,7 @@ Bug fixes:
- Set cursor position when not updating prompt contents. (GH #647)
- Erase status line at exit time for users without altscreen-capable terminals.
(GH #589)
+ - Fix unexpected keys when restoring from suspend (`Ctrl-Z`). (GH #232)
- contrib/vim.tigrc: Also bind G in the main as a workaround for limitations of
the `none` action. (GH #594, #599)
- Only override `blame-options` when commands are given and fix parsing of
diff --git a/src/display.c b/src/display.c
index 26aa7bd5..ec6b01e4 100644
--- a/src/display.c
+++ b/src/display.c
@@ -748,6 +748,9 @@ get_input(int prompt_position, struct key *key)
resize_display();
redraw_display(true);
+ } else if (key_value == KEY_CTL('z')) {
+ raise(SIGTSTP);
+
} else {
int pos, key_length;
@@ -773,9 +776,6 @@ get_input(int prompt_position, struct key *key)
key_value = key_value | 0x40;
}
- if (key_value == KEY_CTL('z'))
- raise(SIGTSTP);
-
if ((key_value >= KEY_MIN && key_value < KEY_MAX) || key_value < 0x1F) {
key->data.value = key_value;
return key->data.value;