aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2016-12-23 14:00:32 -0500
committerGitHub <noreply@github.com>2016-12-23 14:00:32 -0500
commita3b58cd60a6bb40c568ee5af4ea9a3ca5a8f7d09 (patch)
treec9bea5a80703ff2552717637d12401c2bb69233d /runtime
parentf1bfd055a7f461fd6c3770b28d08b922838ee6b0 (diff)
parent657369bb68b08d2c373d6b425ed55e53d5f6789a (diff)
downloadrneovim-a3b58cd60a6bb40c568ee5af4ea9a3ca5a8f7d09.tar.gz
rneovim-a3b58cd60a6bb40c568ee5af4ea9a3ca5a8f7d09.tar.bz2
rneovim-a3b58cd60a6bb40c568ee5af4ea9a3ca5a8f7d09.zip
Merge #5758 from justinmk/fixkbs
tui: check stty/termios for kbs
Diffstat (limited to 'runtime')
-rw-r--r--runtime/autoload/health/nvim.vim22
1 files changed, 8 insertions, 14 deletions
diff --git a/runtime/autoload/health/nvim.vim b/runtime/autoload/health/nvim.vim
index 85c17fa660..f5dacfebcc 100644
--- a/runtime/autoload/health/nvim.vim
+++ b/runtime/autoload/health/nvim.vim
@@ -123,29 +123,23 @@ function! s:check_tmux() abort
endif
endfunction
-function! s:check_terminfo() abort
+function! s:check_terminal() abort
if !executable('infocmp')
return
endif
- call health#report_start('terminfo')
- let suggestions = [
- \ "Set key_backspace to \\177 (ASCII BACKSPACE). Run these commands:\n"
- \ .'infocmp $TERM | sed ''s/kbs=^[hH]/kbs=\\177/'' > $TERM.ti'
- \ ."\n"
- \ .'tic $TERM.ti',
- \ s:suggest_faq]
+ call health#report_start('terminal')
let cmd = 'infocmp -L'
let out = system(cmd)
- let kbs_entry = matchstr(out, 'key_backspace=\S*')
+ let kbs_entry = matchstr(out, 'key_backspace=[^,[:space:]]*')
+ let kdch1_entry = matchstr(out, 'key_dc=[^,[:space:]]*')
if v:shell_error
call health#report_error('command failed: '.cmd."\n".out)
- elseif !empty(matchstr(out, '\Vkey_backspace=^H'))
- call health#report_error('key_backspace (kbs) entry is ^H (ASCII DELETE): '
- \ .kbs_entry, suggestions)
else
- call health#report_info('key_backspace terminfo entry: '
+ call health#report_info('key_backspace (kbs) terminfo entry: '
\ .(empty(kbs_entry) ? '? (not found)' : kbs_entry))
+ call health#report_info('key_dc (kdch1) terminfo entry: '
+ \ .(empty(kbs_entry) ? '? (not found)' : kdch1_entry))
endif
endfunction
@@ -153,6 +147,6 @@ function! health#nvim#check() abort
call s:check_config()
call s:check_performance()
call s:check_rplugin_manifest()
- call s:check_terminfo()
+ call s:check_terminal()
call s:check_tmux()
endfunction