You are not logged in.
Reproduce:
* Compile the file in the wiki (xterm-screen-256color
https://wiki.archlinux.org/index.php/Tmux#xterm-keys
) with `tic`
* add the following to ~/.tmux.conf (as suggested in the wiki)
set-option -g xterm-keys on
set -g default-terminal xterm-screen-256color(although I don't really understand what "xterm-style" mean, the escape sequences
for Home and End appear to be the same regardless of whether the option is set)
Edit: Yes, the wiki doesn't explain it, and the man page only say "xterm-style".
Although it appears that in the current version xterm-keys is the default.
As before, the default `$TERM` is `screen`, but the change is suggested
in the wiki so it should be fine. `$TERM` outside `tmux` is `xterm-256color`
(I changed Xresources as suggested in the wiki
https://wiki.archlinux.org/index.php/Xt … l_Variable )
Of course I tried `set-window-option -g xterm-keys on` too. (although `set-window-option`
is not listed in tmux's man page, I suppose it's an old option)
Open xterm
Open tmux. Observe that `echo $TERM` gives `xterm-screen-256color` now, and
control+left/right and home/end works correctly.
Open `vim --clean`. control+left/right and home/end *still* works correctly.
Execute `:term` in it. Home and End results in `7` and `1` respectively now.
Even <ctrl+v> <home> results in 7.
Control+left/right still works.
Last edited by k395 (2022-01-29 08:11:49)
Offline
... the issue persists even without tmux, xterm is sufficient.
I'll look into the configuration files to see if there's anything stand out.
`xrdb /dev/null` doesn't fix the issue. Neither does deleting `.bashrc`.
The issue in
https://old.reddit.com/r/vim/comments/8 … hen_using/
might be similar. However the issue I'm having does happen in xterm even if tmux server is killed.
Last edited by k395 (2021-03-15 08:59:53)
Offline
Please don't bump. If nobody replied, edit your post to mend it.
Since you figured late that it's not tmux related, are we sure it's vim:term related?
Is the $SHELL actually bash or zsh?
What's the $TERM inside the vim terminal in comparism to the plain xterm?
Offline
Okay.
The issue doesn't happen in a vim buffer, or the outer shell.
$SHELL is /bin/bash.
$TERM is xterm both inside and outside vim.
The issue also happen with home/end with `:term python` (of course Python is Python 3)
The issue doesn't happen with vim:term inside termite, only in xterm.
Although manually calling `TERM=xterm-termite vim --clean` in xterm doesn't work either. (I know this is incorrect)
Offline
Interestingly yes, doesn't happen in urxvt either - seems really limited to xterm.
Despite explicit escape code binding in zsh and "cat" indeed shows that no escape codes are generated.
Edit: vim has a ton of "xterm" tests in its code and symlinking xterm to yterm and running that "yterm -tn rxvt-unicode-256color" gets you a terminal w/ the expected rxvt-unicode-256color (terminfo needs to exist on your system) but the :term launched by vim manages to end in xterm-256color…
Last edited by seth (2021-03-15 15:41:45)
Offline
It appears that the cause is that <xHome> is set to `^[O*H` instead of `^[OH` by default.
I still can't understand why it's the case
(while `<xHome>-xterm` documentation says that the default is `^[OH`)
and why Vim can still recognize the keypress.
It's really weird, because in termite the escape sequence is exactly the same and vim can recognize it without problem.
Update: Not really solved, but this is a workaround.
tmap <kHome> <Home>(also do the map in other modes if you want to -- `map` and `map!` should cover most useful ones, and for `<End>` `<PageUp>` `<PageDown>`)
My keyboard don't even have the NumLock key...
Last edited by k395 (2022-01-29 08:11:04)
Offline