-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
[RFC] health.vim: Fix tmux default-terminal check #6348
Conversation
Oh, yuck. The problem is |
Oh, but we are using |
I was worried about that. Maybe we can just check |
Just confirmed
So we can check both, and if at least one of them returns a sane value, assume it's good. |
runtime/autoload/health/nvim.vim
Outdated
@@ -115,7 +115,7 @@ function! s:check_tmux() abort | |||
|
|||
" check default-terminal and $TERM | |||
call health#report_info('$TERM: '.$TERM) | |||
let cmd = 'tmux show-option -qvg default-terminal' | |||
let cmd = 'tmux show-option -qvgs default-terminal' | |||
let out = system(cmd) | |||
let tmux_default_term = substitute(out, '\v(\s|\r|\n)', '', 'g') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something like this:
if tmux_default_term ==# ''
let cmd = 'tmux show-option -qvgs default-terminal'
let out = system(cmd)
let tmux_default_term = substitute(out, '\v(\s|\r|\n)', '', 'g')
endif
Assuming -qvg
variant returns empty on your system?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just about to get on this 😀 Does it set a non-zero exit code? That'll be better than duplicating substitution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found out in a docker container. Both just return empty strings.
77be393
to
1924c91
Compare
Good enough for now. We can DRY it later if more tmux checks are needed. |
I ran
:CheckHealth
and was aghast when the tmux checker accused me of not settingdefault-terminal
.It was changed to a server option in 2.1. tmux's change log says it's a session option, but that's a typo.