gpakosz / .tmux

🇫🇷 Oh my tmux! My self-contained, pretty & versatile tmux configuration made with ❤️
MIT License
21.79k stars 3.36k forks source link

ssh + tmux + vim/less $TERM problems #643

Closed jeskowagner closed 1 year ago

jeskowagner commented 1 year ago

Hi and thank you for these dotfiles!

I love them already, but had some troubles around $TERM. My setup is ssh > tmux (v. 3.3). Then, using less (or vim) produced some warnings and errors.

E.g. less gives WARNING: terminal is not fully functional and vim: E437: terminal capability "cm" required.

On the host machine (before tmux), $TERM is xterm-256color. Within the tmux session it's tmux-256color.

Forcing $TERM to xterm-256color fixes the problem. Presumably $TERM is changed during a call to _apply_tmux_256color. Indeed, commenting out the call to _apply_tmux_256color in .tmux.conf fixes the problem too. $TERM remains at screen-256color this way (as dictacted by .tmux.conf's line set -g default-terminal "screen-256color")

I was wondering what might be causing this problem and what the cleanest way to circumvent it is (for now I am sticking to removing the call to _apply_tmux_256color.

Best, Jesko

gpakosz commented 1 year ago

Hello @jeskowagner 👋

Whats' your OS? How did you install support for tmux-256color that Oh my tmux! is detecting?

In any case, you can edit your .local customization file copy and add

set -g default-terminal 'screen-256color'
jeskowagner commented 1 year ago

Thanks for your quick response and sorry for not including more info in the first comment.

My OS is Scientific Linux, which is essentially CentOS 7. I did not install tmux-256color myself, but presumably it came along with my installation of tmux through conda. For example, using infocmp -x tmux-256color I can see

Reconstructed via infocmp from file: /path/to/env/share/terminfo/t/tmux-256color  

tmux-256color|tmux with 256 colors

Restoring the call to _apply_tmux_256color in .tmux.conf and adding set -g default-terminal 'screen-256color' to .tmux.conf.local results in the same issue I described in the first comment, unless I add #!important.

gpakosz commented 1 year ago

Ah yeah I've seen broken tmux-256color along with Conda but I'm not sure how it's happening and what's broken exactly.

Ah sure #!important is the way to go!

gpakosz commented 1 year ago

And maybe it's worth reporting to Conda that the tmux-256color terminfo is broken in their version of ncurses

jeskowagner commented 1 year ago

Closing as now reported in this issue. Thanks again for your swift help!