Sunday, November 20, 2016

Re: Hiding cursor with t_ve in terminal

On Sun, Nov 20, 2016 at 6:52 AM, Bram Moolenaar <Bram@moolenaar.net> wrote:
>
> Brett Stahlman wrote:
>
>> Vim's documentation lists 't_vi' as "cursor invisible" and 't_ve' as
>> "cursor visible", but provides no hints on usage. Naively, I would
>> have guessed that Vim would send the 't_vi' sequence when you somehow
>> indicated that the cursor should be hidden (e.g., using something
>> analogous to 'guicursor' for terminals), but there doesn't appear to
>> be any such mechanism. The only way I've been able to hide the cursor
>> in a terminal is to make the "cursor visible" option empty: e.g.,
>>
>> set t_ve=
>>
>> I interpret this behavior as follows: when you tell Vim there's no way
>> to make the cursor visible, it immediately uses the 't_vi' option
>> value to make it *invisible*. This was less than intuitive to me, and
>> I didn't see it documented in the Vim help. Is the behavior
>> well-defined? Can anyone give a better explanation of what's happening
>> and perhaps the rationale behind it? Have I simply missed the
>> pertinent documenation?
>
> Traditionally terminals show the cursor even when drawing text. So on
> your 300 baud modem you could see the cursor move ahead of the text that
> was displayed. Now that text is drawn instantly, updating the cursor
> just becomes flickering. So Vim disables the cursor before drawing
> text, and switches it back on when done.
>
> The setting is termcap thing, telling Vim what escape sequence to use.

Makes sense, but out of curiosity, why is the cursor hidden
*immediately* when I clear t_ve, even when no text is being drawn?
Even if I do the `set t_ve=' in a silent mapping (to ensure no text is
being changed), the cursor disappears immediately. I'm actually glad
it works this way - I just want to be sure it's intended behavior,
and not likely to change...

Thanks,
Brett Stahlman

>
> --
> A day without sunshine is like, well, night.
>
> /// 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 ///

--
--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: