zsh, solarized: Random typed keys shown on screen with wierd colors.

294 views
Skip to first unread message

Ory Band

unread,
Sep 14, 2014, 5:42:45 AM9/14/14
to vim...@googlegroups.com
Hey.

Randomly, Vim prints keys I type on the keyboard where my cursor is located, in all modes (normal, insert, visual). For example, in normal mode I press 'j', then an oddly colored 'j' char appears where my cursor was before the cursor moved when char below. This happens in random and inconsistently.

The problem started when I moved from Bash to Zsh with oh-my-zsh, solarized-dark colorscheme. This happened on my Mac OSX and also on Xubuntu, so I guess this is not OS related. This also happens inside and outside tmux.

I have my $TERM set correctly I presume: 'xterm-256-color' outside TMUX, and 'screen-256-color' inside TMUX. In Vim 'term' is set according to outside environment $TERM, and also 't_Co=256'.

Problem occurs with and without 'ttyfast', 'lazyredraw'.

I'm really lost about how to fix this. No hints on the intertubes besides the above. Can anybody help?

Thanks for your time.

Nathan Schwarz

unread,
Sep 14, 2014, 7:57:02 AM9/14/14
to vim...@googlegroups.com
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Try disabling oh-my-zsh (however that shouldn't have effect on the
behaviour in bim).
Which terminal emulators do you use?

- Nathan

--
/"\ ASCII Ribbon Campaign
\ / - against HTML emails
X - against proprietory attachments
/ \ http://en.wikipedia.org/wiki/ASCII_Ribbon_Campaign

Dan Lowe

unread,
Sep 15, 2014, 11:13:30 AM9/15/14
to vim...@googlegroups.com
On Sun, Sep 14, 2014, at 05:42 AM, Ory Band wrote:
>
> I have my $TERM set correctly I presume: 'xterm-256-color' outside TMUX,
> and 'screen-256-color' inside TMUX. In Vim 'term' is set according to
> outside environment $TERM, and also 't_Co=256'.

I don't know if this has any bearing on your problem, but I believe the
correct terminal names do not have the second hyphen you are using, e.g.
I have always seen these name as follows:

xterm-256color
screen-256color

Dan

Ory Band

unread,
Sep 22, 2014, 4:29:47 AM9/22/14
to vim...@googlegroups.com

Yeah, I'm using the correct names (the ones you wrote). I had a typo when writing this post.

Ory Band

unread,
Sep 22, 2014, 4:31:19 AM9/22/14
to vim...@googlegroups.com
On Monday, September 15, 2014 6:13:30 PM UTC+3, Dan Lowe wrote:

I'm using urxvt on Xubuntu 14.04, but this problem also occured on iTerm2 on Mac OSX Mavericks.

I'll try disabling omzsh and see if it fixes anything.

Any other ideas?

Ory Band

unread,
Sep 28, 2014, 9:02:14 AM9/28/14
to vim...@googlegroups.com
Doesn't anybody have a clue how to fix this? It's driving me crazy!

Christian Brabandt

unread,
Sep 28, 2014, 9:06:30 AM9/28/14
to vim...@googlegroups.com

On So, 28 Sep 2014, Ory Band wrote:
> Doesn't anybody have a clue how to fix this? It's driving me crazy!

Are you using any plugins? I have seen something like this, when Vim is
busy executing e.g. autocommands that take a little while (or when the
system is under heavy load).

Best,
Christian
--
Liebe ist ein Käfig mit Gitterstäben aus Glück.
-- Claudia Cardinale

Jan Larres

unread,
Oct 2, 2014, 11:12:02 PM10/2/14
to vim...@googlegroups.com
Christian Brabandt <cbl...@256bit.org>:
> On So, 28 Sep 2014, Ory Band wrote:
>> Doesn't anybody have a clue how to fix this? It's driving me crazy!
>
> Are you using any plugins? I have seen something like this, when Vim is
> busy executing e.g. autocommands that take a little while (or when the
> system is under heavy load).

I just wanted to chime in that I'm also experiencing this on Linux with
urxvt (and zsh, but without oh-my-zsh). It doesn't seem to be related to
the machine/Vim being busy in any way, it can happen at any time.

The only plugin-related thing I could think of having an influence are
ones that use a CursorMoved/CursorMovedI autocommand, which for me are:

:autocmd CursorMoved
--- Auto-Commands ---
CursorMoved
* call UltiSnips#CursorMoved()
matchparen CursorMoved
* call s:Highlight_Matching_Pair()
youcompleteme CursorMoved
* call s:OnCursorMovedNormalMode()

I haven't tried selectively disabling them yet to see wether one of them
is the culprit as the problem is a bit sporadic and I use these plugins
regularly, but maybe I should still give it a shot.

-Jan

--
-[ OpenPGP key ID: 00A0FD5F ]-
The most dangerous phrase in the language is, "We've always done it this
way."
-- Grace Hopper

Christian Brabandt

unread,
Oct 3, 2014, 7:36:52 AM10/3/14
to vim...@googlegroups.com
Hi Jan!

On Fr, 03 Okt 2014, Jan Larres wrote:

> Christian Brabandt <cbl...@256bit.org>:
> > On So, 28 Sep 2014, Ory Band wrote:
> >> Doesn't anybody have a clue how to fix this? It's driving me crazy!
> >
> > Are you using any plugins? I have seen something like this, when Vim is
> > busy executing e.g. autocommands that take a little while (or when the
> > system is under heavy load).
>
> I just wanted to chime in that I'm also experiencing this on Linux with
> urxvt (and zsh, but without oh-my-zsh). It doesn't seem to be related to
> the machine/Vim being busy in any way, it can happen at any time.
>
> The only plugin-related thing I could think of having an influence are
> ones that use a CursorMoved/CursorMovedI autocommand, which for me are:
>
> :autocmd CursorMoved
> --- Auto-Commands ---
> CursorMoved
> * call UltiSnips#CursorMoved()
> matchparen CursorMoved
> * call s:Highlight_Matching_Pair()
> youcompleteme CursorMoved
> * call s:OnCursorMovedNormalMode()
>
> I haven't tried selectively disabling them yet to see wether one of them
> is the culprit as the problem is a bit sporadic and I use these plugins
> regularly, but maybe I should still give it a shot.

Does it happen, without youcompleteme?

Best,
Christian
--
Älter werden bedeutet, mit Eleganz Dinge sein lassen zu können.
-- Reinhard Mey

Ory Band

unread,
Oct 14, 2014, 3:47:24 AM10/14/14
to vim...@googlegroups.com
I can say for myself that for me it does happen with YCM disabled, and I have tried turning off "busy" plugins to no avail. Disabling plugins might postpone the problem a bit, but it eventually start showing after vim has been running for some time (like 10 minutes or so).

I've no clue what is causing this.

Here's my .vimrc, you can see the plugins at the top (using Vundle): https://github.com/oryband/dotvim/blob/master/.vimrc

Ory Band

unread,
Oct 28, 2014, 4:29:28 AM10/28/14
to vim...@googlegroups.com
Still, no one has a clue? This happens on almost every file type.

Another idea - Maybe I should compile vim on my own and leave out / leave in some features?

romainla...@gmail.com

unread,
Oct 29, 2014, 5:36:15 AM10/29/14
to vim...@googlegroups.com
Le mardi 28 octobre 2014 09:29:28 UTC+1, Ory Band a écrit :
> Still, no one has a clue? This happens on almost every file type.
>
> Another idea - Maybe I should compile vim on my own and leave out / leave in some features?

Try removing these two lines from your vimrc:

if $TMUX != "" | set term=screen-256color | endif
set t_Co=256

Ory Band

unread,
Oct 29, 2014, 5:43:36 AM10/29/14
to vim...@googlegroups.com
I had the problem on my macbook pro 2010 before using tmux when using iterm2, so I guess this won't solve it.

Ory Band - אורי בנד


--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to a topic in the Google Groups "vim_use" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/UVxDG3lMQ0U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vim_use+u...@googlegroups.com.

Ory Band

unread,
May 9, 2015, 8:57:37 AM5/9/15
to vim...@googlegroups.com
Well, I'm reviving this post because I've made some progress and also for the sake of documentation. People might find this useful:

I've seem to track down the origin of the problem, but haven't quite solved it. It's related to 2 things: Vim's slow way of coloring syntax and vim's slow regex engine. Which both come down to that fact that Vim does some thing slowly, which make it print garbage characters to the screen.

See the following issue on the vim-go plugin repo. It happened a lot when writing go, and apparently it was because the plugin uses heavy regex matching to color syntax:

https://github.com/fatih/vim-go/issues/145
https://github.com/fatih/vim-go/issues/388

I haven't noticed it before, but this bug is visible when moving through long code lines. This probably caused vim to make "heavy regex calculations" on that line which took some time to finish, resulting in garbage characters.

If I turn of syntax coloring after a certain column using `set synmaxcol=100` (instead of my default `synmaxcol=3000`, who knows which plugin set this), then this bug is reduced dramatically, because vim doesn't check the regex past the 100th column. However, this still pops up every now and then, and not completely fixed.

If anyone here has some deeper knowledge of vim and can help me with completely fixing this bug, I'll be grateful.

Thanks!
Reply all
Reply to author
Forward
0 new messages