diff options
Diffstat (limited to 'src/keyboard.c')
| -rw-r--r-- | src/keyboard.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index a88298dabcf..0f7a49d3832 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -95,18 +95,7 @@ volatile int interrupt_input_blocked; | |||
| 95 | during the current critical section. */ | 95 | during the current critical section. */ |
| 96 | int interrupt_input_pending; | 96 | int interrupt_input_pending; |
| 97 | 97 | ||
| 98 | |||
| 99 | #ifdef HAVE_WINDOW_SYSTEM | ||
| 100 | /* Make all keyboard buffers much bigger when using X windows. */ | ||
| 101 | #ifdef MAC_OS8 | ||
| 102 | /* But not too big (local data > 32K error) if on Mac OS Classic. */ | ||
| 103 | #define KBD_BUFFER_SIZE 512 | ||
| 104 | #else | ||
| 105 | #define KBD_BUFFER_SIZE 4096 | ||
| 106 | #endif | ||
| 107 | #else /* No X-windows, character input */ | ||
| 108 | #define KBD_BUFFER_SIZE 4096 | 98 | #define KBD_BUFFER_SIZE 4096 |
| 109 | #endif /* No X-windows */ | ||
| 110 | 99 | ||
| 111 | #ifdef MULTI_KBOARD | 100 | #ifdef MULTI_KBOARD |
| 112 | KBOARD *initial_kboard; | 101 | KBOARD *initial_kboard; |
| @@ -2715,6 +2704,8 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) | |||
| 2715 | /* if redisplay was requested */ | 2704 | /* if redisplay was requested */ |
| 2716 | if (commandflag >= 0) | 2705 | if (commandflag >= 0) |
| 2717 | { | 2706 | { |
| 2707 | int echo_current = EQ (echo_message_buffer, echo_area_buffer[0]); | ||
| 2708 | |||
| 2718 | /* If there is pending input, process any events which are not | 2709 | /* If there is pending input, process any events which are not |
| 2719 | user-visible, such as X selection_request events. */ | 2710 | user-visible, such as X selection_request events. */ |
| 2720 | if (input_pending | 2711 | if (input_pending |
| @@ -2738,6 +2729,12 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time) | |||
| 2738 | swallow_events (0); | 2729 | swallow_events (0); |
| 2739 | /* If that cleared input_pending, try again to redisplay. */ | 2730 | /* If that cleared input_pending, try again to redisplay. */ |
| 2740 | } | 2731 | } |
| 2732 | |||
| 2733 | /* Prevent the redisplay we just did | ||
| 2734 | from messing up echoing of the input after the prompt. */ | ||
| 2735 | if (commandflag == 0 && echo_current) | ||
| 2736 | echo_message_buffer = echo_area_buffer[0]; | ||
| 2737 | |||
| 2741 | } | 2738 | } |
| 2742 | 2739 | ||
| 2743 | /* Message turns off echoing unless more keystrokes turn it on again. | 2740 | /* Message turns off echoing unless more keystrokes turn it on again. |
| @@ -7234,7 +7231,7 @@ tty_read_avail_input (struct terminal *terminal, | |||
| 7234 | if (n_to_read > sizeof cbuf) | 7231 | if (n_to_read > sizeof cbuf) |
| 7235 | n_to_read = sizeof cbuf; | 7232 | n_to_read = sizeof cbuf; |
| 7236 | #else /* no FIONREAD */ | 7233 | #else /* no FIONREAD */ |
| 7237 | #if defined (USG) || defined (DGUX) || defined(CYGWIN) | 7234 | #if defined (USG) || defined(CYGWIN) |
| 7238 | /* Read some input if available, but don't wait. */ | 7235 | /* Read some input if available, but don't wait. */ |
| 7239 | n_to_read = sizeof cbuf; | 7236 | n_to_read = sizeof cbuf; |
| 7240 | fcntl (fileno (tty->input), F_SETFL, O_NDELAY); | 7237 | fcntl (fileno (tty->input), F_SETFL, O_NDELAY); |
| @@ -7284,9 +7281,9 @@ tty_read_avail_input (struct terminal *terminal, | |||
| 7284 | ); | 7281 | ); |
| 7285 | 7282 | ||
| 7286 | #ifndef FIONREAD | 7283 | #ifndef FIONREAD |
| 7287 | #if defined (USG) || defined (DGUX) || defined (CYGWIN) | 7284 | #if defined (USG) || defined (CYGWIN) |
| 7288 | fcntl (fileno (tty->input), F_SETFL, 0); | 7285 | fcntl (fileno (tty->input), F_SETFL, 0); |
| 7289 | #endif /* USG or DGUX or CYGWIN */ | 7286 | #endif /* USG or CYGWIN */ |
| 7290 | #endif /* no FIONREAD */ | 7287 | #endif /* no FIONREAD */ |
| 7291 | 7288 | ||
| 7292 | if (nread <= 0) | 7289 | if (nread <= 0) |