diff options
| author | memeplex | 2019-10-19 00:13:15 -0300 |
|---|---|---|
| committer | Eli Zaretskii | 2019-10-26 13:29:29 +0300 |
| commit | e3cebbb839fc94f314659bf667c6790edebf4297 (patch) | |
| tree | 304bedf735cd2d5da6c8290e808cfac457acefad /src/keyboard.c | |
| parent | 16372a5a04c1bf2028941dec6bbdbf75d1f61a62 (diff) | |
| download | emacs-e3cebbb839fc94f314659bf667c6790edebf4297.tar.gz emacs-e3cebbb839fc94f314659bf667c6790edebf4297.zip | |
Replay key if kboard is interrupted while initializing (Bug#37782)
The problem with the original fix for bug#5095 is that it drops
the current event, which is a valid character event and not -2.
Thus, the first ESC character sent by the terminal after turning
on focus tracking is lost and we get '[' and 'I' events separately
inserted into the buffer afterwards.
* src/keyboard.c (read_key_sequence): Add key as mock_input and replay
sequence using new keyboard, when the key is not -2.
Diffstat (limited to 'src/keyboard.c')
| -rw-r--r-- | src/keyboard.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index 56ab79068ad..0eab8fdfae1 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -9596,7 +9596,16 @@ read_key_sequence (Lisp_Object *keybuf, Lisp_Object prompt, | |||
| 9596 | Fcons (make_lispy_switch_frame (frame), | 9596 | Fcons (make_lispy_switch_frame (frame), |
| 9597 | KVAR (interrupted_kboard, kbd_queue))); | 9597 | KVAR (interrupted_kboard, kbd_queue))); |
| 9598 | } | 9598 | } |
| 9599 | mock_input = 0; | 9599 | if (FIXNUMP (key) && XFIXNUM (key) == -2) |
| 9600 | mock_input = 0; | ||
| 9601 | else | ||
| 9602 | { | ||
| 9603 | /* If interrupted while initializing terminal, we | ||
| 9604 | need to replay the interrupting key. See | ||
| 9605 | Bug#5095 and Bug#37782. */ | ||
| 9606 | mock_input = 1; | ||
| 9607 | keybuf[0] = key; | ||
| 9608 | } | ||
| 9600 | goto replay_entire_sequence; | 9609 | goto replay_entire_sequence; |
| 9601 | } | 9610 | } |
| 9602 | } | 9611 | } |