aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-03-06 03:02:43 +0100
committerJustin M. Keyes <justinkz@gmail.com>2017-03-06 03:17:40 +0100
commite5be3aaaefe75bd5ba1d0ac98bf1d9622e649adb (patch)
treef328b4ad82f0c109a6a8c5f3c52e7bfba4fc3088
parente32ec03d67eebc9e63b1f2be53423cf95e9933e0 (diff)
downloadrneovim-e5be3aaaefe75bd5ba1d0ac98bf1d9622e649adb.tar.gz
rneovim-e5be3aaaefe75bd5ba1d0ac98bf1d9622e649adb.tar.bz2
rneovim-e5be3aaaefe75bd5ba1d0ac98bf1d9622e649adb.zip
health.vim: tmux $TERM, default-terminal
-rw-r--r--runtime/autoload/health/nvim.vim16
1 files changed, 13 insertions, 3 deletions
diff --git a/runtime/autoload/health/nvim.vim b/runtime/autoload/health/nvim.vim
index e2ad9f7ccb..a1bf9b21cf 100644
--- a/runtime/autoload/health/nvim.vim
+++ b/runtime/autoload/health/nvim.vim
@@ -113,11 +113,21 @@ function! s:check_tmux() abort
call health#report_ok('escape-time: '.tmux_esc_time.'ms')
endif
- " check $TERM
+ " check default-terminal and $TERM
call health#report_info('$TERM: '.$TERM)
- if $TERM !~# '\v(tmux-256color|screen-256color)'
+ let cmd = 'tmux show-option -qvg default-terminal'
+ let out = system(cmd)
+ let tmux_default_term = substitute(out, '\v(\s|\r|\n)', '', 'g')
+ if v:shell_error
+ call health#report_error('command failed: '.cmd."\n".out)
+ elseif tmux_default_term !=# $TERM
+ call health#report_info('default-terminal: '.tmux_default_term)
+ call health#report_error(
+ \ '$TERM differs from the tmux `default-terminal` setting. Colors might look wrong.',
+ \ ['$TERM may have been set by some rc (.bashrc, .zshrc, ...).'])
+ elseif $TERM !~# '\v(tmux-256color|screen-256color)'
call health#report_error(
- \ '$TERM should be "screen-256color" or "tmux-256color" when running tmux.',
+ \ '$TERM should be "screen-256color" or "tmux-256color" in tmux. Colors might look wrong.',
\ ["Set default-terminal in ~/.tmux.conf:\nset-option -g default-terminal \"screen-256color\"",
\ s:suggest_faq])
endif