Add :silent
in xolox#misc#os#is_mac() to prevent junk on terminal.
#29
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The function
xolox#misc#os#is_mac()
uses Vim'ssystem()
function toinvoke
uname
for platform detection. By default, Vim'ssystem()
function sets the terminal to "cooked" mode during execution of the
external program. Normally this would not be a problem, but there are
some sensitive moments during Vim startup where terminal settings are
being negotiated; at these times, changing to "cooked" mode can disrupt
this negotiation.
In particular, the vim-session plugin uses this
is_mac()
functionduring a
VimEnter
auto-command. When processingVimEnter
, terminalssuch as Kitty are in the midst of terminal negotiations. The visible
effect is that escape sequences such as the below may end up on screen
after invoking
vim
with no arguments:^[[2;2R^[[3;1R^[[>1;4000;20c^[]10;rgb:dddd/dddd/dddd^[^[]11;rgb:0000/0000/0000^[\
To avoid this, use
:silent
withsystem()
as recommended in:help system()
.This problem can be demonstrated in complete isolation from any plugins
by having an empty
~/.vim
directory and the below three lines as thesole contents of
~/.vimrc
:augroup Something
au VimEnter * call system("true", "")
augroup END
Using Kitty, the above will reliable generate the junk characters shown
above when invoking
vim
with no arguments.