mouseterm-plus
mouseterm-plus copied to clipboard
Bug when I open a file using vim
I use spf13-vim. It shows strange codes after I open a file.
Thanks for your reporting.
Progress report:
I installed spf13-vim. I found that this problem can be reproduced on other terminals.
XTerm patch level 314
Tera Term 4.85
I'm debugging it with trachet.
Naked vim can handle answers for tcap-query sequences. I suspect any of vim plugins (which may use some maps or getchar() function) prevents it.
@liudangyi Can you make the minimal reproducible VimScript example for this problem? Or can you tell me which plugin causes this problem?
Following vimrc script will reproduce the problem.
set rtp+=~/.vim/bundle/vundle
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'bling/vim-airline'
Bundle 'majutsushi/tagbar'
set laststatus=2
syntax on
@liudangyi Thanks!
@liudangyi Now I understand what causes this problem.
This is not terminal's issue.
When vim accept responses for tcap-query
, the terminal should be set to "raw mode" to prevent echo-back.
But some vim plugins do shell dispatching at same timing. It set the terminal to "cooked mode" for a moment.
I think this is vim's issue. The following patch will solve your problem. But it might produce unintended side effects.
diff -r 3af822eb4da5 src/os_unix.c
--- a/src/os_unix.c Sat Feb 28 13:11:45 2015 +0100
+++ b/src/os_unix.c Sun Mar 01 23:11:24 2015 +0900
@@ -4179,8 +4179,10 @@
goto error;
out_flush();
+#if 0
if (options & SHELL_COOKED)
settmode(TMODE_COOK); /* set to normal mode */
+#endif
/*
* Do this loop twice:
@liudangyi This patch for the tagbar
plugin may be better solution. Can you tell me whether it works?
diff --git a/autoload/tagbar.vim b/autoload/tagbar.vim
index 49b2eff..e4b26cf 100644
--- a/autoload/tagbar.vim
+++ b/autoload/tagbar.vim
@@ -3644,7 +3644,7 @@ function! s:ExecuteCtags(ctags_cmd) abort
call s:debug(v:statusmsg)
redraw!
else
- let ctags_output = system(a:ctags_cmd)
+ silent let ctags_output = system(a:ctags_cmd)
endif
if &shell =~ 'cmd\.exe'
Sorry, but it doesn't work.
Nothing is changed?
Above patch solves this "echo-back" problem at least in my environment (with default settings of spf-13, vim 7.4.648 in OSX/vim 7.4.589 in Debian sid).
Yes, nothing changed.
OK, please try the following patch for vim.
(Former patch for src/os_unix.c
is buggy. It had bad side effects against :shell
and :!
command.)
https://gist.github.com/saitoha/9819c355445e269f87ff
I sent the patch for this issue to vim_dev.
https://groups.google.com/d/msg/vim_dev/8ciQGDB-0Og/NiaJYwQHKF8J
I'm glad if you test it.