Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jeskowagner opened this issue May 6, 2023 · 5 comments
Closed

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

jeskowagner opened this issue May 6, 2023 · 5 comments

Comments

@jeskowagner
Copy link

jeskowagner commented May 6, 2023

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
Copy link
Owner

gpakosz commented May 7, 2023

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
Copy link
Author

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
Copy link
Owner

gpakosz commented May 7, 2023

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
Copy link
Owner

gpakosz commented May 7, 2023

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

@jeskowagner
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants