[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
maybe it's XTerm? (was: terminfo fixes to prevent cursor blink from stop
Greg A. Woods
maybe it's XTerm? (was: terminfo fixes to prevent cursor blink from stopping when it shouldn't)
Mon, 03 Jul 2017 16:34:46 -0700
Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Goj ) APEL/10.8 Emacs/23.3 (x86_64--netbsd) MULE/6.0 (HANACHIRUSATO)
At Sun, 2 Jul 2017 20:47:16 -0400, Thomas Dickey <address@hidden> wrote:
Subject: Re: terminfo fixes to prevent cursor blink from stopping when it
> This has been an occasional issue (almost exclusively by people using
> emacs on Linux console...) since I added the control sequence to
> xterm in 2003. But actually (checking the history), the combination
> which you're commenting on dates back at least another ten years for the
> AT&T terminals.
> As I recall it, the problem is that emacs mishandles the very-visible
> cursor setting:
> cursor_visible cvvis vs make cursor very
> and rather than treating it as something for occasional emphasis, emacs
> just uses it routinely. On exit of course, it resets the cursor to "normal".
Sorry, I think I may have drawn incorrect conclusions just from reading
documentation and too little source, and not doing enough manual testing!
Emacs does have the following variable (since 2005, apparently):
visible-cursor is a variable defined in `C source code'.
Its value is t
Non-nil means to make the cursor very visible.
This only has an effect when running in a text terminal.
What means "very visible" is up to your terminal. It may make the
bigger, or it may make it blink, or it may do nothing at all.
Note that it is set to 't', so enabled. It is this way by default.
In all the searching I did for "blinking" I didn't find this -- it
wasn't until I searched for "cursor_visible" and "cursor_normal" that I
finally found the function src/term.c:tty_set_terminal_modes() which is
used to implement this visible-cursor feature.
Reading the emacs source now with what I've learned suggests to me that
it is using the terminfo variables cursor_normal, cursor_visible, and
cursor_invisible all correctly (at least as I understand their
So, perhaps I'm not to the root of this problem yet.
The system I'm using is NetBSD near -current, with terminfo rev. 1.11,
aka terminfo-20170128.src. I currently use "XTerm(318)" on it.
Finally doing some real testing I find that from an xterm-318 running on
this system, with TERM=xterm in the environment, sending cvvis causes
blinking to stop. Now that's unexpected, at least to me!
So, hmmmm.... Maybe the bug is in Xterm?
# cursor is blinking
$ tput cvvis | od -c
0000000 033 [ ? 1 2 ; 2 5 h
$ tput cvvis
# cursor no longer blinks
$ tput cnorm | od -c
0000000 033 [ ? 1 2 l 033 [ ? 2 5 h
$ tput norm
# cursor blinks again
$ tput civis | od -c
0000000 033 [ ? 2 5 l
$ tput civis
# cursor disappears
$ tput cnorm
# blinking cursor re-appears
On the other hand if I start xterm with '+bc' on the command line then
"tput cvvis" does NOT make the cursor blink, which is more like what I
would expect, given the documentation (and of course it does start up
with a non-blinking cursor when given '+bc', as expected).
I happened to find an older XTerm(304) that will run on this NetBSD
system, and it behaves the same as the native 318.
I have the newer XTerm(326) on my macOS system, and it also behaves the
same as those older versions.
My oldest system runs XTerm(200) with termcap. There the termcap source
specifies ":ve=\E[?25h:vi=\E[?25l:vs=\E[?25h:" in the "xterm" entry, so
no use of \E[?12 either way. On that system everything behaves as
expected even with a quite new emacs since of course only the xterm
resource, cmd-line, or menu can control cursor blinking.
It would seem that XTerm is mis-interpreting \E[?12l and \E[?12h when
cursorBlink is enabled -- it should probably not ever stop blinking
(just as it does not ever start blinking when the '+bc' argument is given)
Perhaps it would be nice to allow \E[?12 to enable and disable blinking,
but maybe that should only happen if there is no explicit user setting
of cursorBlink (either true or false) or use of '-bc' or '+bc' on the
command line. Otherwise allowing the application to control blinking
seems wrong to me. (Emacs would control blinking correctly with its
visible-cursor variable in this case too.)
However I don't know how that translates for other terminals or
emulators where controlling cursor blink isn't quite so easy as it is
In the mean time perhaps removing all trace of \E[?12 from terminfo
seems best for my needs across the variety of my systems since patching
xterm on them all isn't as easy as patching terminfo.
Greg A. Woods
<address@hidden> +1 250 762-7675 http://www.planix.com/
Description: PGP signature