Commit 1fb8c4ad authored by Karoly Lorentey's avatar Karoly Lorentey
Browse files

Work around mysterious breakage of arrow key recognition under screen (see first TODO in README).

* src/keyboard.c (Fset_input_mode): Call reset_sys_modes and
  init_sys_modes on the selected device only; do not use the bulk
  functions reset_all_sys_modes and init_all_sys_modes.

git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-358
parent e7cf0fa0
......@@ -377,6 +377,30 @@ is probably not very interesting for anyone else.)
THINGS TO DO
------------
** Having {reset,init}_all_sys_modes in set-input-mode breaks arrow
keys on non-selected terminals under screen, and sometimes on other
terminal types as well. The other function keys continue to work
fine. Sometimes faces on these screens become garbled.
This only seems to affect displays that are of the same terminfo
type as the selected one. Interestingly, in screen Emacs normally
reports the up arrow key as `M-o A', but after the above SNAFU, it
complains about `M-[ a'. UNIX ttys are a complete mystery to me,
but it seems the reset-reinitialize cycle somehow leaves the
non-selected terminals in a different state than usual. I have no
idea how this could happen.
Currently set-input-mode resets only the currently selected
terminal, which seems to somehow work around the problem.
** Fix set-input-mode for multi-tty. It's a truly horrible interface;
what if we'd blow it up into several separate functions (with a
compatibility definition)?
** BULK RENAME: The `display-' prefix of new Lisp-level functions
conflicts with stuff like `display-time-mode'. Use `device-'
instead.
** The single-keyboard mode of MULTI_KBOARD is extremely confusing
sometimes; Emacs does not respond to stimuli from other keyboards.
At least a beep or a message would be important, if the single-mode
......@@ -415,10 +439,6 @@ THINGS TO DO
** standard-display-table should be display-local.
standard-display-european should be display-local.
** Fix set-input-mode for multi-tty. It's a truly horrible interface;
what if we'd blow it up into several separate functions (with a
compatibility definition)?
** Have a look at Vlocale_coding_system. Seems like it would be a
tedious job to localize it, although most references use it for
interfacing with libc and are therefore OK with the global
......@@ -445,11 +465,6 @@ THINGS TO DO
(This is likely an error in the CVS trunk.)
** The terminal customization files in term/*.el tend to change global
parameters, which may confuse Emacs with multiple displays. Change
them to tweak only frame-local settings, if possible. (They tend
to call define-key to set function key sequences a lot.)
** Dan Nicolaescu suggests that -nw should be added as an alias for -t
in emacsclient. Good idea. (Alas, implementing this is not
trivial, getopt_long does not seem to support two-letter ``short''
......@@ -1050,4 +1065,12 @@ DIARY OF CHANGES
(Done, by an ugly hack.)
-- The terminal customization files in term/*.el tend to change global
parameters, which may confuse Emacs with multiple displays. Change
them to tweak only frame-local settings, if possible. (They tend
to call define-key to set function key sequences a lot.)
(Done, by making `function-key-map' terminal-local (i.e., part of
struct kboard). This has probably covered all the remaining problems.)
;;; arch-tag: 8da1619e-2e79-41a8-9ac9-a0485daad17d
......@@ -10584,8 +10584,9 @@ See also `current-input-mode'. */)
#endif
#ifndef DOS_NT
/* this causes startup screen to be restored and messes with the mouse */
reset_all_sys_modes ();
if (FRAME_TERMCAP_P (XFRAME (selected_frame)))
/* this causes startup screen to be restored and messes with the mouse */
reset_sys_modes (CURTTY ());
#endif
#ifdef SIGIO
......@@ -10628,7 +10629,8 @@ See also `current-input-mode'. */)
quit_char = XINT (quit) & (NILP (meta) ? 0177 : 0377);
#ifndef DOS_NT
init_all_sys_modes ();
if (FRAME_TERMCAP_P (XFRAME (selected_frame)))
init_sys_modes (CURTTY ());
#endif
#ifdef POLL_FOR_INPUT
......
......@@ -1725,6 +1725,7 @@ nil means don't delete them until `list-processes' is run. */);
if (tty_out->term_initted && no_redraw_on_reenter)
{
/* XXX This seems wrong on multi-tty. */
if (display_completed)
direct_output_forward_char (0);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment