vim / vim

The official Vim repository
https://www.vim.org
Vim License
36.39k stars 5.44k forks source link

Cursor is flickering when terminal is active #2943

Open ramele opened 6 years ago

ramele commented 6 years ago

No issues with the cursor while running the following script using :term job.sh, but it is flickering with :vert term job.sh (in both vim and gvim) and with :bo term job.sh on gvim:

$ cat job.sh

!/bin/bash

for i in seq 1 20000; do sleep 0.005 echo "$i" done

To reproduce: $ (g)vim -u NONE :vert term job.sh " or :bo CTRL-Ww " look at the cursor

I'm running Vim 8.1.10 on RHEL 6.

Thanks, Ramel

dvenum commented 6 years ago

I cant reproduce on debian jessie with xterm and vim-8.1.0001.

ramele commented 6 years ago

Actually, I noticed something strange with gnome terminal on ubuntu (16.04) -when I open a terminal and also after starting vim the cursor is blinking, but when I start :term inside vim the cursor stops blinking, also after exiting vim (so there is no flickering). I believe that this is another issue..

You can still see the original issue in the gui (after moving the empty window to the top): gifrecord_2018-05-23_232512

dvenum commented 6 years ago

Got it on xterm, my mistake about job.sh. If not your issue, I had to think it normal. Now, it will annoy me too. smile I don't know, how cursor is drawing yet and I will check it in freetime, it can be interest. Hope to see more comments here about what this can be.

brammool commented 6 years ago

Got it on xterm, my mistake about job.sh. If not your issue, I had to think it normal. Now, it will annoy me too. :smile: I don't know, how cursor is drawing yet and I will check it in freetime, it can be interest. Hope to see more comments here about what this can be.

It might be unavavoidable. In most terminals the cursor shows up where text is being redrawn, moving forward when outputting text. Vim has to hide the cursor while this is happening, and then restore it to its original position. Thus it will be hidden for a short moment.

In the GUI we might do something more clever, don't hide it if we are redrawing another window (and we know no scrolling will happen, no menu pops up, etc.).

-- For large projects, Team Leaders use sophisticated project management software to keep track of who's doing what. The software collects the lies and guesses of the project team and organizes them in to instantly outdated charts that are too boring to look at closely. This is called "planning". (Scott Adams - The Dilbert principle)

/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\ \\ an exciting new programming language -- http://www.Zimbu.org /// \\ help me help AIDS victims -- http://ICCF-Holland.org ///

dvenum commented 6 years ago

Thanks for your answer. Nice to known it.

tmpm697 commented 4 years ago

I have the same issue, weird part is that neovim does not have this issue.