Subject: Re: bug#33513: 26.1; emacsclient forgetting keybinds set by tty-setup-hook

From: Hadrien Lacour <[email-masked]>
Date: Sat, 28 Nov 2020 10:12:58 +0100

On Fri, Nov 27, 2020 at 09:41:37AM +0100, Lars Ingebrigtsen wrote:
> Hadrien Lacour <[email-masked]> writes:
>
> >> > (define-key input-decode-map "^[[1;5A" [C-up])
> >>
> >> [...]
> >>
> >> > I get the keybinds I want when using emacs -nw with st, but when using
> >> > emacs --daemon and emacsclient, these work only the first time:
> >> > $ emacs --daemon
> >> > $ emacsclient -nw myfile # no problem, close with C-x C-c
> >> > $ emacsclient -nw myfile # from here, tty frames don't remember the bindings
> >>
> >> (This bug report unfortunately got no response at the time.)
> >>
> >> What key stroke is "^[[1;5A" (etc) representing?
>
> [...]
>
> > as the line says, "Ctrl + Up arrow". I think I stopped used
> > emacsclient because of this, actually.
>
> When I use emacsclient -nw (Debian bullseye), `C-up' works without
> altering input-decode-map, so I'm wondering why your terminal is sending
> key sequences making it necessary to alter input-decode-map.

Most probably because Emacs has some defaults for xterm based terminals, which
st isn't. And Emacs needs those defaults because "C-up" isn't described by
terminfo.

Anyway, that's not really the problem, the bindings shouldn't
disappear. Mind you, I haven't try to reproduce it with the current version,
I'll probably get to it.