Multiple windows get corrupted

69 views
Skip to first unread message

Ben Mehmet

unread,
Dec 18, 2022, 8:09:18 PM12/18/22
to vim_use
When running vim (mostly) in multi-window mode in ubuntu, my windows get corrupted with random characters. Hard to explain, but as if the screen doesn't get refreshed. Like to see the actual buffer contents, I have to move up or down continuously. I try ctrl-r or :e with no result. I am on vim 8.2 and ubuntu 22.04.
I appreciate any help with this matter.

Enan Ajmain

unread,
Dec 19, 2022, 12:59:56 AM12/19/22
to vim...@googlegroups.com
Have you checked if '$ vim --clean' causes the same problem?

--
Enan
3nan....@gmail.com
https://git.sr.ht/~enan/
https://www.github.com/3N4N

Christian Brabandt

unread,
Dec 19, 2022, 5:33:01 AM12/19/22
to vim...@googlegroups.com
Have you tried using `Ctrl-L` or the ex command `:redraw` (with or
without the `!`)?

Does it fix it?

Also, are you running vim in a terminal or using a GUI? Can you verify
using the latest Vim version?

Thanks,
Chris

hilal Adam

unread,
Dec 19, 2022, 3:55:33 PM12/19/22
to vim...@googlegroups.com
Thanks for your reply. I am not sure what '$ vim --clean' does. Is this another way running vim?



--
--
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+unsub...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20221219115946.1e45bebf%40cirdan.

hilal Adam

unread,
Dec 19, 2022, 4:03:53 PM12/19/22
to vim...@googlegroups.com

Thanks for your reply. Yes, I did try Ctrl-L or the ex command :redraw as I found them when searching for similar experience from others.
I am running in GUI mode. 

Latest version meaning what? Vim 9 or the latest in 8.2xxx build? As I mentioned I am running 8.2.4919. 
However I would be glad to upgrade to Vim 9. The problem however when I tried this upgrade on a non work environment by cloning and building vim, the steps didn't mentioned how to go about populating all the other sub folders under vim. Example, plugin, syntax, colors, etc.

Thanks,
Ben

--
--
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+unsub...@googlegroups.com.

Enan Ajmain

unread,
Dec 20, 2022, 12:03:00 AM12/20/22
to vim...@googlegroups.com
On Mon, 19 Dec 2022 20:55:23 +0000 (UTC)
"'hilal Adam' via vim_use" <vim...@googlegroups.com> wrote:
> Thanks for your reply. I am not sure what '$ vim --clean' does. Is
> this another way running vim? On Monday, December 19, 2022 at

You have to run it from your shell. It'll open Vim without any
user-level configuration. If the issue persists without your user-level
config, we can be sure it's a bug in Vim. But if it can't be reproduced
without '--clean', then we can be sure the problem is being caused by
your config. Either way, it'll narrow the suspects.

Read ':h --clean' for more details.

Ben Mehmet

unread,
Dec 31, 2022, 12:17:27 AM12/31/22
to vim_use
Got an update regarding this. As you suggested, I ran vim with --clean option and it is much more reliable and steadier than I have been experiencing for past few months. Could you help with recommending how to proceed with my .vimrc and plugins to find the culprit? I mean how should I start incorporating my settings in? 
Question 2: If I wanted to updated my vim version to 9, would it be recommended and most importantly safe to use the ppa approach? 

Thanks a lot in advance.

Steve Martin

unread,
Dec 31, 2022, 5:26:01 AM12/31/22
to vim_use
Not sure to whom you might be addressing this, but my general method would be to remove plugins and try to see if vim is still stable. Then add plugins back to the configuration until problems start to appear. That way you might find out what is causing the problem.

Enan Ajmain

unread,
Dec 31, 2022, 6:38:50 AM12/31/22
to vim...@googlegroups.com
On Fri, 30 Dec 2022 21:17:26 -0800 (PST)
Ben Mehmet <ozu...@gmail.com> wrote:
> Could you help with recommending how to proceed with my .vimrc and
> plugins to find the culprit? I mean how should I start incorporating
> my settings in?

https://vi.stackexchange.com/questions/2003/how-do-i-debug-my-vimrc-file
Message has been deleted

Ben Mehmet

unread,
May 30, 2023, 9:38:18 PM5/30/23
to vim_use
Everybody FYI... I thank all the replies I have gotten related to this issue which I should mention I have not figured out what the cause is. I followed the suggestion provided and was not able to find which, if any, plugin caused it. However, by pure chance I recently discovered one thing. So when that text garbling happened (and happened very often), I just used exit my vim session and open all files in session until next time it misbehaved again. Well the discovery that I made recently is that when that happened to me, instead of exiting, I could either pull the right edge of the window either in or out for a pixel or two OR snap the vim session window to either left or right (on linux like using super key and left/right arrow keys) of the screen and it refreshed my windows/buffers and things would look normal until next time it misbehaved.
Does this discovery point in any direction as to what my issue is and how to remedy it permanently?

Thanks in advance.
Ben

Bram Moolenaar

unread,
May 31, 2023, 7:48:24 AM5/31/23
to vim...@googlegroups.com, Ben Mehmet

> Everybody FYI... I thank all the replies I have gotten related to this
> issue which I should mention I have not figured out what the cause is. I
> followed the suggestion provided and was not able to find which, if any,
> plugin caused it. However, by pure chance I recently discovered one thing.
> So when that text garbling happened (and happened very often), I just used
> exit my vim session and open all files in session until next time it
> misbehaved again. Well the discovery that I made recently is that when that
> happened to me, instead of exiting, I could either *pull *the right edge of
> the window either in or out for a pixel or two OR *snap *the vim session
> window to either left or right (on linux like using super key and
> left/right arrow keys) of the screen and it refreshed my windows/buffers
> and things would look normal until next time it misbehaved.
> Does this discovery point in any direction as to what my issue is and how
> to remedy it permanently?

Perhaps a window resize event makes Vim recompute some things and then
it works again? Just guessing.

If some option gets a wrong value, such as 'lines' or 'columns', that
would cause display errors. You could do the following:

redir > /tmp/settings_1
set! all
redir END

Do this when everything works OK and later when things are wrong, using
a different file name. Then compare the output and try to spot the
difference. If you see an option with a suspect value, you can possibly
find out where it was set with e.g.:

:verbose set lines?

--
From "know your smileys":
8<}} Glasses, big nose, beard

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Ben Mehmet

unread,
May 31, 2023, 10:11:40 AM5/31/23
to vim_use
Thank you. I will follow the troubleshooting steps you highlighted.

Ben Mehmet

unread,
May 31, 2023, 4:08:28 PM5/31/23
to vim_use
Ok. So as expected it happened again. And I followed the steps you (Bram) mentioned. I have following diffs between the bad (left side) and good (right side):

columns=258   <-----> columns=120
lines=72   <-----> lines=60
modified   <-----> nomodified
scroll=35   <-----> scroll=29
window=71   <-----> window=59

lines, columns, and window are set in my .gvimrc. I am experimenting with commenting them out to see if any effect. 

Any ideas from your side?

Thanks.

Bram Moolenaar

unread,
Jun 1, 2023, 5:01:20 AM6/1/23
to vim...@googlegroups.com, Ben Mehmet

> Ok. So as expected it happened again. And I followed the steps you (Bram)
> mentioned. I have following diffs between the bad (left side) and good
> (right side):
>
> columns=258 <-----> columns=120
> lines=72 <-----> lines=60
> modified <-----> nomodified
> scroll=35 <-----> scroll=29
> window=71 <-----> window=59
>
> lines, columns, and window are set in my .gvimrc. I am experimenting with
> commenting them out to see if any effect.
>
> Any ideas from your side?

The number of columns and lines has changed. Did the Vim window
actually change size? It would have gotten more than twice as wide.
Or the font has changed to a much smaller one.

You can try resizing it, e.g. by grabbing the left or right size and
dragging it just enough to make the window one character wider or
smaller. Then check if the 'columns' and 'lines' options did change.

--
I AM THANKFUL...
...for the taxes that I pay because it means that I am employed.

Ben Mehmet

unread,
Jun 1, 2023, 2:55:31 PM6/1/23
to vim_use
On Thursday, June 1, 2023 at 5:01:20 AM UTC-4 Bram Moolenaar wrote:

> Ok. So as expected it happened again. And I followed the steps you (Bram)
> mentioned. I have following diffs between the bad (left side) and good
> (right side):
>
> columns=258 <-----> columns=120
> lines=72 <-----> lines=60
> modified <-----> nomodified
> scroll=35 <-----> scroll=29
> window=71 <-----> window=59
>
> lines, columns, and window are set in my .gvimrc. I am experimenting with
> commenting them out to see if any effect.
>
> Any ideas from your side?

The number of columns and lines has changed. Did the Vim window
actually change size? It would have gotten more than twice as wide.
Or the font has changed to a much smaller one.
Actually that is my doing. I had (as I usually do) start a session with just one window enough to display one file. So the 258 size is a result of my widening the vim window to make room for multiple windows (files). 


You can try resizing it, e.g. by grabbing the left or right size and
dragging it just enough to make the window one character wider or
smaller. Then check if the 'columns' and 'lines' options did change.
I did as you asked and answer is yes columns option did change by just one character increase. 

Ben Mehmet

unread,
Jun 1, 2023, 2:56:49 PM6/1/23
to vim_use
Sorry I made a mess with my posting above as I was trying to reply to specific points in your post.

Bram Moolenaar

unread,
Jun 1, 2023, 3:27:32 PM6/1/23
to vim...@googlegroups.com, Ben Mehmet

> > You can try resizing it, e.g. by grabbing the left or right size and
> > dragging it just enough to make the window one character wider or
> > smaller. Then check if the 'columns' and 'lines' options did change.
>
> I did as you asked and answer is yes columns option did change by just
> one character increase.

Well, does that make the problem go away?


--
From "know your smileys":
:-| :-| Deja' vu!

Ben Mehmet

unread,
Jun 1, 2023, 4:04:03 PM6/1/23
to vim_use
As I mentioned in my post that begins with "Everybody FYI" I had just recently discovered that pulling the edge of the window left or right when the garbling happened it made it the problem go away.
But I was hoping to find a fix for my problem so that it doesn't happen; specially when I am pair coding with a colleague. It gets frustrating specially since I couldn't figure out yet a keyboard short cut for pulling side of window left or right.

Bram Moolenaar

unread,
Jun 1, 2023, 4:55:16 PM6/1/23
to vim...@googlegroups.com, Ben Mehmet

> As I mentioned in my post that begins with "Everybody FYI" I had just
> recently discovered that pulling the edge of the window left or right when
> the garbling happened it *made *it the problem go away.
> But I was hoping to find a fix for my problem so that it doesn't happen;
> specially when I am pair coding with a colleague. It gets frustrating
> specially since I couldn't figure out yet a keyboard short cut for pulling
> side of window left or right.

OK, so just before resizing the window manually Vim somehow is in a bad
state. It most likely is related to how the Vim window was resized. Do
you know? In case you are not sure you could use:

verbose set columns?
verbose set lines?

Hopefully this leads to some Vim script or an autocommand that triggers
the problem. We need this to be able to write a test for it anyway.
Note that you need to start Vim with "--clean" to make sure your local
setup doesn't change what happens.

--
From "know your smileys":
|-( Contact lenses, but has lost them

Ben Mehmet

unread,
Jun 1, 2023, 5:18:58 PM6/1/23
to vim_use
On Thursday, June 1, 2023 at 4:55:16 PM UTC-4 Bram Moolenaar wrote:

> As I mentioned in my post that begins with "Everybody FYI" I had just
> recently discovered that pulling the edge of the window left or right when
> the garbling happened it *made *it the problem go away.
> But I was hoping to find a fix for my problem so that it doesn't happen;
> specially when I am pair coding with a colleague. It gets frustrating
> specially since I couldn't figure out yet a keyboard short cut for pulling
> side of window left or right.

OK, so just before resizing the window manually Vim somehow is in a bad
state. It most likely is related to how the Vim window was resized. Do
you know? In case you are not sure you could use:
Yes. As I mentioned before I would resize the window to accommodate for a opening another file in side window.
 
verbose set columns?
verbose set lines?

Hopefully this leads to some Vim script or an autocommand that triggers
the problem. We need this to be able to write a test for it anyway.
Note that you need to start Vim with "--clean" to make sure your local
setup doesn't change what happens.
Regarding starting Vim with "--clean". The "--clean" option was suggested sometime at the start of this thread. It ran with no issues but it also considerably limited my editing capabilities.
Did I answer your query correctly/completely?

Thanks.
 

Bram Moolenaar

unread,
Jun 1, 2023, 5:51:10 PM6/1/23
to vim...@googlegroups.com, Ben Mehmet

> > > As I mentioned in my post that begins with "Everybody FYI" I had just
> > > recently discovered that pulling the edge of the window left or right when
> > > the garbling happened it *made *it the problem go away.
> > > But I was hoping to find a fix for my problem so that it doesn't happen;
> > > specially when I am pair coding with a colleague. It gets frustrating
> > > specially since I couldn't figure out yet a keyboard short cut for pulling
> > > side of window left or right.
> >
> > OK, so just before resizing the window manually Vim somehow is in a bad
> > state. It most likely is related to how the Vim window was resized. Do
> > you know? In case you are not sure you could use:
>
> Yes. As I mentioned before I would resize the window to accommodate for a
> opening another file in side window.

The big question is: HOW did you resize the window? Resizing manually
fixes the problem, thus you didn't resize it the normal way, right?

> > verbose set columns?
> > verbose set lines?
> >
> > Hopefully this leads to some Vim script or an autocommand that triggers
> > the problem. We need this to be able to write a test for it anyway.
> > Note that you need to start Vim with "--clean" to make sure your local
> > setup doesn't change what happens.
>
> Regarding starting Vim with "--clean". The "--clean" option was suggested
> sometime at the start of this thread. It ran with no issues but it also
> considerably limited my editing capabilities.

The idea is that you start Vim with "--clean" and then add pieces of
your setup until you find out what piece matters for reproducing the
problem. Hopefully not including a whole plugin, since then we would
need to dig into that plugin.

--
From "know your smileys":
<|-) Chinese
<|-( Chinese and doesn't like these kind of jokes

Ben Mehmet

unread,
Jun 1, 2023, 6:02:43 PM6/1/23
to vim_use
On Thursday, June 1, 2023 at 5:51:10 PM UTC-4 Bram Moolenaar wrote:

> > > As I mentioned in my post that begins with "Everybody FYI" I had just
> > > recently discovered that pulling the edge of the window left or right when
> > > the garbling happened it *made *it the problem go away.
> > > But I was hoping to find a fix for my problem so that it doesn't happen;
> > > specially when I am pair coding with a colleague. It gets frustrating
> > > specially since I couldn't figure out yet a keyboard short cut for pulling
> > > side of window left or right.
> >
> > OK, so just before resizing the window manually Vim somehow is in a bad
> > state. It most likely is related to how the Vim window was resized. Do
> > you know? In case you are not sure you could use:
>
> Yes. As I mentioned before I would resize the window to accommodate for a
> opening another file in side window.

The big question is: HOW did you resize the window? Resizing manually
fixes the problem, thus you didn't resize it the normal way, right?
 
Oh. Missed your question here. So I would just use the mouse to pull the side of the window out to make the window wider. 

> > verbose set columns?
> > verbose set lines?
> >
> > Hopefully this leads to some Vim script or an autocommand that triggers
> > the problem. We need this to be able to write a test for it anyway.
> > Note that you need to start Vim with "--clean" to make sure your local
> > setup doesn't change what happens.
>
> Regarding starting Vim with "--clean". The "--clean" option was suggested
> sometime at the start of this thread. It ran with no issues but it also
> considerably limited my editing capabilities.

The idea is that you start Vim with "--clean" and then add pieces of
your setup until you find out what piece matters for reproducing the
problem. Hopefully not including a whole plugin, since then we would
need to dig into that plugin.

" Hopefully not including a whole plugin, since then we would need to dig into that plugin."  ??? 
Not clear on this. 
What does "add pieces" mean? Does it mean pieces of the the vimrc file or adding plugins one by one or is it actually both?

Bram Moolenaar

unread,
Jun 2, 2023, 9:14:09 AM6/2/23
to vim...@googlegroups.com, Ben Mehmet

> > > > > As I mentioned in my post that begins with "Everybody FYI" I had just
> > > > > recently discovered that pulling the edge of the window left
> > > > > or right when the garbling happened it *made *it the problem
> > > > > go away. But I was hoping to find a fix for my problem so
> > > > > that it doesn't happen; specially when I am pair coding with a
> > > > > colleague. It gets frustrating specially since I couldn't
> > > > > figure out yet a keyboard short cut for pulling side of window
> > > > > left or right.
> > > >
> > > > OK, so just before resizing the window manually Vim somehow is in a bad
> > > > state. It most likely is related to how the Vim window was resized. Do
> > > > you know? In case you are not sure you could use:
> > >
> > > Yes. As I mentioned before I would resize the window to accommodate for a
> > > opening another file in side window.
> >
> > The big question is: HOW did you resize the window? Resizing manually
> > fixes the problem, thus you didn't resize it the normal way, right?
>
> Oh. Missed your question here. So I would just use the mouse to pull the
> side of the window out to make the window wider.

But then you can avoid the problem by doing it again? That doesn't give
any hint about why it happened the first time. Can you think of
anything that might matter?

> > > > verbose set columns?
> > > > verbose set lines?
> > > >
> > > > Hopefully this leads to some Vim script or an autocommand that triggers
> > > > the problem. We need this to be able to write a test for it anyway.
> > > > Note that you need to start Vim with "--clean" to make sure your local
> > > > setup doesn't change what happens.
> > >
> > > Regarding starting Vim with "--clean". The "--clean" option was suggested
> > > sometime at the start of this thread. It ran with no issues but it also
> > > considerably limited my editing capabilities.
> >
> > The idea is that you start Vim with "--clean" and then add pieces of
> > your setup until you find out what piece matters for reproducing the
> > problem. Hopefully not including a whole plugin, since then we would
> > need to dig into that plugin.
> >
> > " Hopefully not including a whole plugin, since then we would need to dig
> > into that plugin." ???
>
> Not clear on this.
> What does "add pieces" mean? Does it mean pieces of the the vimrc file or
> adding plugins one by one or is it actually both?

Both. In the case of using your vimrc file, you can put a "finish"
command in various places and see what the effect is. Binary search
should work fastest. But start by putting it near the top to check that
it actually matters to be there at all.

For plugins you could rename them temporarily, e.g. by changing ".vim"
to ".skip".

--
From "know your smileys":
:-* A big kiss!

Ben Mehmet

unread,
Jun 2, 2023, 9:23:25 AM6/2/23
to vim_use
Ok. Thanks for all the help. I hope to report back in a couple of weeks.
Reply all
Reply to author
Forward
0 new messages