Shell END key does not work in Doom Emacs

I have recently noticed that when I press the END key in Doom Emacs it shows <select> is undefined.

I don't know how this happened or when it started but it looks like my keyboard mapping has changed.

Anyone know how to redefine it so that the cursor is moved to the end of the line. HOME takes me to the beginning of the line as expected.
 
After consulting ChatGPT and doing what was suggested, nothing helped, but then GROK suggested that if none of the suggested solutions worked and I was using tmux, to try running emacs outside of tmux, and that showed emacs to be working as expected so the problem seems to be related to tmux.

Any ideas?
 
After more experimenting, when I use LxTerminal (the terminal which comes with LXDE) then the same behaviour occurs as it does with Xterm, ie emacs behaves normally when run directly from the terminal but when run through tmux the END key simply displays <select> is undefined so it looks like tmux is messing things up.

Any ideas on where to look?
 
According to GROK:-


the end key does not work in doom emacs when run under tmux


Thought for 61m 10s
Yes, this is a classic issue — the End key doesn't work properly in Doom Emacs (or any Emacs) when running inside tmux.

Why it happens​

Tmux (and screen) often translates the End key to the [select] escape sequence instead of the proper [end] sequence.

Fix for Doom Emacs + tmux​

Add this to your ~/.doom.d/config.el:


Code:
(after! evil
  ;; Fix End key in tmux
  (define-key input-decode-map [select] [end])
  (define-key input-decode-map [C-select] [C-end])
  (define-key input-decode-map [M-select] [M-end])
  (define-key input-decode-map [S-select] [S-end]))

Does this seem reasonable?

I'll give it a try to find out.
 
Back
Top