Wednesday, June 15, 2022

Re: Cursors

Bram Moolenaar wrote:

> > Why cursor shape in terminal neovim can change but in vim not? Maybe
> > something different in here.
>
> It very much depends on the terminal. Neovim assumes a very recent
> terminal, it won't work everywhere. It may mess up on some terminals.
>
> What I use myself:
>
> " Change the cursor color and shape depending on the mode.
> if &term =~ "xterm" && $SSH_CLIENT == ''
> let &t_SI = "\<Esc>]12;purple\x7" . "\<Esc>[5 q"
> try
> let &t_SR = "\<Esc>]12;darkred\x7" . "\<Esc>[3 q"
> catch
> endtry
> let &t_EI = "\<Esc>]12;royalblue2\x7" . "\<Esc>[2 q"
> endif

I use something along those lines too.
But why the try/catch? I don't have it and did not notice issues.
Doing :help termcap-cursor-shape also shows how to set colored
cursor, but that help entry does not have the try / catch either.
Perhaps it should be added there if it solves something.

A bit off topic but related: on macOS, I use iTerm2 (with
TERM=xterm-256color) and cursor color does not change unfortunately.
I have not found workarounds. Yet it it's a popular terminal on macOS.
I find it quite bad, and I don't find any good terminals on macOS in fact
whereas on Linux, most terminals work well in general. Things that do not
work well with iTerm2:

* can't change cursor color (I can choose cursor colors in
settings, but vim can't dynamically change it later)
* underline and squiggly lines have no colors
* several bugs with tmux (version next-3.4, the real tmux, not the
crappy one built-in in iTerm2) e.g. bugs when trying to copy paste
in window pane while another pane is outputing text, slowness
dragging window pane separators.

Regards

Dominique

--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CAON-T_jkkuB07JhB2YaN6TwEFhypOPf7ej4Q6zsdSuQHr%3D_f6A%40mail.gmail.com.

No comments:

Post a Comment