You are not logged in.
My main annoyance with tmux is that
control+left/right doesn't work correctly out of the box.
If I understood correctly from this answer https://unix.stackexchange.com/a/34723,
it's because of a limitation in "`screen`-based terminfo database entries"
(which if I understood correctly, is the `/usr/share/terminfo/s/screen` file,
and can be viewed with `infocmp screen`)
. Therefore programs like `vim` must be manually configured.
* Why can't tmux use another "terminfo database entries"? Like the one of xterm?
Is it just too hard to implement, or is there a technical limitation?
* But why is it not defined, while `screen`-like programs definitely does support it?
Can it be manually defined?
======
`set-window-option -g xterm-keys on` doesn't change the broken behavior in vim.
Last edited by k395 (2021-03-15 01:09:27)
Offline
Works fine for me (binding those combinations). What term are you using in tmux?
Offline
Tmux in xterm.
What do you mean by "binding those combinations"? Edit vimrc?
======
I forgot to explain that control+left/right only fail in vim, it works in `TERM=xterm vim` (although I think this is a coincidence, because tmux should send key codes defined in screen terminfo. If I understood correctly, `xterm-keys` only make tmux send xterm-style escape codes, not escape codes identical to xterm). And it works in `bash` too (although home/end fails in `TERM=xterm bash`)
Last edited by k395 (2021-03-14 10:04:34)
Offline
https://wiki.archlinux.org/index.php/Tm … rrect_term
What does your $TERM say if you don't set it to xterm?
Offline
Good point.
Unfortunately it doesn't work. Both `TERM=tmux vim --clean` and `TERM=tmux-256color vim --clean` have the same corrupted behavior with control+left/right, with or without `xterm-keys`.
Offline
Did you add the terminfo from the wiki?
Offline
... Okay, it works now.
I still don't understand why tmux doesn't send xterm's default escape sequences.
As an excuse, most answers I found on stackoverflow.com/Unix SE are terrible, scattered around with several very similar questions, and doesn't explain what is going on.
A new question that arises: Why default `$TERM` in xterm is `xterm` rather than `xterm-256color`? It definitely does support 256 color.
... actually https://wiki.archlinux.org/index.php/Xterm does explain it, but why is it not the default?
I get that you should expect to have to do a lot of configuration with this operating system, but isn't it better to have a sensible default...
Offline
Because tmux isn't xterm and the client (vim) talks to tmux, not xterm.
tmux *could* run in an xterm, but you could kill that xterm and connect to tmux (w/ the still running vim) from the console or putty next and then what?
About the termName default, arch ships the unaltered upstream app-defaults.
The value is likely conservative because of compatibility concerns, but idk.
https://invisible-island.net/xterm/xter … m_terminfo
Offline