bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

terminfo fixes to prevent cursor blink from stopping when it shouldn't


From: Greg A. Woods
Subject: terminfo fixes to prevent cursor blink from stopping when it shouldn't
Date: Sat, 01 Jul 2017 12:39:38 -0700
User-agent: 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)

Hi Thomas,

Yesterday I decided I finally solved a mystery that's been bothering me
for over two years:  Why and how does emacs on my NetBSD-current system
disable cursor blink when running in an xterm???

It had only slightly nagged me as a problem for some time as I normally
never use emacs in an xterm, and this is the only system where I might
occasionally do so, but since it also NFS-mounts my $HOME and /src, I
rarely if ever used emacs in an xterm running on this system.  Yesterday
I was doing real work on that system though and I got very frustrated.

At first I blamed that particular build of emacs because this was also a
unique version of emacs in my working environment; and because vi didn't
turn off blink on the same system.  I searched the emacs source it was
built from for a clue but I could find none.

Then I tried to blame that particular version of xterm, but it seemed to
only be a problem with emacs.

In the end a clue in the following question lead me to realize that this
system was also the only one I would normally get to use emacs built
against ncurses in an xterm, and a quick run of "infocmp" and I had my
answer.

https://unix.stackexchange.com/questions/3759/how-to-stop-cursor-from-blinking

So, I don't know quite who decided that they didn't like cursor blinking
so much that the default terminfo sources should be sprinkled with
settings to turn it off by default on many terminals, including xterm,
but I really hate it.  I rely very much on being able to spot the cursor
on a large screen of text without having to move it.  It MUST blink for
me.

I was doubly disappointed to find this was happening on xterm where the
user has a simple menu to toggle cursor blink to their desire; and
aggravated that I would have to restore my preferred setting every time
I re-started or un-suspended this one application (unlike all others, or
so it seems)!

I think the following patch might be the best way to make a fair change
to the way cursor blink is controlled, though I'm not sure the \E[?12h
values should be left in cvvis since I'm not familiar with how ncurses
uses cvvis and how many applications might trigger its use.  Perhaps all
occurrences of \E[?12h and \E[?12l (and all places the same sequences
are in a multiple parameter combo) should be removed from the default
terminfo sources.  I no longer use real terminals and I don't know or
remember if any where this might matter have an easily accessible setup
option to set cursor blink to the user's preference.

There are a few other wee changes you may find useful here too.

-- 
                                        Greg A. Woods <address@hidden>

+1 250 762-7675                           RoboHack <address@hidden>
Planix, Inc. <address@hidden>     Avoncote Farms <address@hidden>

Index: terminfo
===================================================================
RCS file: /cvs/master/m-NetBSD/main/src/share/terminfo/terminfo,v
retrieving revision 1.8
diff -u -u -r1.8 terminfo
--- terminfo    15 Nov 2015 06:43:17 -0000      1.8
+++ terminfo    1 Jul 2017 19:14:36 -0000
@@ -1939,11 +1939,11 @@
        colors#8, cols#80, it#8, lines#25, ncv#19, pairs#64, wsl#80,
        acsc=Oa``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
        bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,
-       clear=\E[2J\E[H, cnorm=\E[?25h\E[?12l, cr=^M,
+       clear=\E[2J\E[H, cnorm=\E[?25h, cr=^M,
        csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=\E[D,
        cud=\E[%p1%dB, cud1=\E[B, cuf=\E[%p1%dC, cuf1=\E[C,
        cup=\E[%i%p1%d;%p2%dH$<5>, cuu=\E[%p1%dA, cuu1=\E[A,
-       cvvis=\E[?12;25h, dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m,
+       cvvis=\E[?25h, dch=\E[%p1%dP, dch1=\E[P, dim=\E[2m,
        dl=\E[%p1%dM, dl1=\E[1M, dsl=\E[r, ech=\E[%p1%dX, ed=\E[J,
        el=\E[K, el1=\E[1K\E[X, flash=\E[?5h$<200>\E[?5l,
        fsl=\E[?6h\E8, home=\E[H, hpa=\E[%i%p1%dG, ht=^I, hts=\EH,
@@ -2349,10 +2349,14 @@
        
sgr=\2330%?%p6%t;1%;%?%p2%t;4%;%?%p4%t;5%;%?%p5%t2%;%?%p7%t8%;%?%p1%p3%|%t;7%;m,
        sgr0=\2330m, smso=\2337m, smul=\2334m,
 
-# NetBSD "wscons" emulator in vt220 mode.
+# NetBSD "wscons" emulator in vt100 mode (options WSEMUL_VT100).
+#
 # This entry is based on the NetBSD termcap entry, correcting the ncv value.
 # The emulator renders underlined text in red.  Colors are otherwise usable.
 #
+# xxx the following should have been obvious:  it is called "vt100" in the 
source!
+# (the string "vt220" does not appear in any variation in the source)
+#
 # Testing the emulator and reading the source code (NetBSD 2.0), it appears
 # that "vt220" is inaccurate.  There are a few vt220-features, but most of the
 # vt220 screens in vttest do not work with this emulator.  For instance, it
@@ -2361,13 +2365,18 @@
 # from Kermit's emulation of vt220, does not correspond to actual vt220.  At
 # the level of detail in a termcap, it is a passable emulator, since ECH does
 # work.  Don't use it on a VMS system -TD
-wsvt25|NetBSD wscons in 25 line DEC VT220 mode,
+#
+# XXX This should NOT use vt220!  It should be complete, accurate, & 
stand-alone.
+#
+wsvt25|NetBSD wscons in 25 line DEC VT100 mode,
        bce, msgr,
-       colors#8, cols#80, it#8, lines#25, ncv#2, pairs#64,
-       civis=\E[?25l, cnorm=\E[?25h, is2=\E[r\E[25;1H,
-       kdch1=\E[3~, kend=\E[8~, kf1=\E[11~, kf10=\E[21~,
+       xenl@,
+       colors#8, lines#25, ncv#2, pairs#64,
+       civis=\E[?25l, cnorm=\E[?25h,
+       is2=\E[r\E[25;1H, kdch1=\E[3~, kend=\E[8~, kf1=\E[11~, kf10=\E[21~,
        kf11=\E[23~, kf12=\E[24~, kf2=\E[12~, kf3=\E[13~,
        kf4=\E[14~, kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~,
+       smcup=\E)0, rmcup=\E)B,
        kf9=\E[20~, khome=\E[7~, op=\E[m, rs1=\Ec,
        setab=\E[4%p1%dm, setaf=\E[3%p1%dm, use=vt220,
 
@@ -2377,7 +2386,11 @@
 # `rasterconsole' provided by 4.4BSD, NetBSD and OpenBSD on SPARC, and
 # DECstation/pmax.
 rcons|BSD rasterconsole,
+       mir@,
        use=sun-il,
+# hi-res version of above.
+rcons-bwtwo|rcons-hires|rcons on Sun Workstation with high-res display,
+       cols#120, lines#52, use=rcons,
 # Color version of above. Color currently only provided by NetBSD.
 rcons-color|BSD rasterconsole with ANSI color,
        bce,
@@ -3806,7 +3819,7 @@
 
 # This version was released in XFree86 4.4.
 xterm-xf86-v44|xterm terminal emulator (XFree86 4.4 Window System),
-       cnorm=\E[?12l\E[?25h, cvvis=\E[?12;25h, indn=\E[%p1%dS,
+       cnorm=\E[?25h, cvvis=\E[?12;25h, indn=\E[%p1%dS,
        rin=\E[%p1%dT, use=xterm-xf86-v43,
 
 xterm-xfree86|xterm terminal emulator (XFree86),
@@ -3992,7 +4005,7 @@
        colors#8, cols#80, it#8, lines#24, pairs#64,
        acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
        bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,
-       clear=\E[H\E[2J, cnorm=\E[?12l\E[?25h, cr=^M,
+       clear=\E[H\E[2J, cnorm=\E[?25h, cr=^M,
        csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
        cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
        cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
@@ -4108,7 +4121,7 @@
        acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
        bel=^G, blink=\2335m, bold=\2331m, cbt=\233Z,
        civis=\233?25l, clear=\233H\2332J,
-       cnorm=\233?25l\233?25h, cr=^M, csr=\233%i%p1%d;%p2%dr,
+       cnorm=\233?25h, cr=^M, csr=\233%i%p1%d;%p2%dr,
        cub=\233%p1%dD, cub1=^H, cud=\233%p1%dB, cud1=^J,
        cuf=\233%p1%dC, cuf1=\233C, cup=\233%i%p1%d;%p2%dH,
        cuu=\233%p1%dA, cuu1=\233A, cvvis=\233?12;25h,
@@ -5257,7 +5270,7 @@
        colors#8, cols#80, it#8, lines#24, ncv#3, pairs#64,
        acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
        bel=^G, bold=\E[1m, civis=\E[?25l, clear=\E[H\E[2J,
-       cnorm=\E[?12l\E[?25h, cr=^M, csr=\E[%i%p1%d;%p2%dr,
+       cnorm=\E[?25h, cr=^M, csr=\E[%i%p1%d;%p2%dr,
        cub1=^H, cud=\E[%p1%dB, cud1=^J, cuf=\E[%p1%dC, cuf1=\E[C,
        cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
        dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K,
@@ -5810,8 +5823,8 @@
 # <lines> capability later corrected by J.T. Conklin <address@hidden>
 # SGR 1, 4 aren't supported - removed bold/underline (T.Dickey 17 Jan 1998)
 sun-il|Sun Microsystems console with working insert-line,
-       am, km, msgr,
-       cols#80, lines#34,
+       am, km, msgr, mir,
+       cols#80, it#8, lines#34,
        bel=^G, clear=^L, cr=^M, cub1=^H, cud1=^J, cuf1=\E[C,
        cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, dch=\E[%p1%dP,
        dch1=\E[P, dl=\E[%p1%dM, dl1=\E[M, ed=\E[J, el=\E[K, ht=^I,
@@ -5825,6 +5838,10 @@
        kres=\E[193z, kund=\E[195z, rev=\E[7m, rmso=\E[m, rmul@,
        rs2=\E[s, sgr=\E[0%?%p1%p3%|%t;7%;m, sgr0=\E[m,
        smso=\E[7m, u8=\E[1t, u9=\E[11t,
+#
+sun-bwtwo|sun-bw2|sun-hires|Sun Microsystems Workstation console with high-res 
display,
+       cols#120, lines#52, use=sun,
+#
 # On some versions of CGSIX framebuffer firmware (SparcStation 5), <il1>/<il>
 # flake out on the last line.  Unfortunately, without them the terminal has no
 # way to scroll.
@@ -5890,6 +5907,7 @@
 #      blink=\E[5m
 # It supports bold, but not underline -TD (2009-09-19)
 sun-color|Sun Microsystems Workstation console with color support (IA systems),
+       bce,
        colors#8, ncv#3, pairs#64,
        bold=\E[1m, cub=\E[%p1%dD, cud=\E[%p1%dB, cuf=\E[%p1%dC,
        cuu=\E[%p1%dA, home=\E[H, op=\E[0m, rs2=\E[s,
@@ -11352,7 +11370,7 @@
        cols#80, it#8, lh#2, lines#24, lw#8, nlab#8, wsl#80,
        acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
        bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,
-       clear=\E[H\E[J, cnorm=\E[?25h\E[?12l, cr=^M,
+       clear=\E[H\E[J, cnorm=\E[?25h, cr=^M,
        csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
        cud=\E[%p1%dB, cud1=\E[B, cuf=\E[%p1%dC, cuf1=\E[C,
        cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
@@ -11426,7 +11444,7 @@
        cols#80, it#8, lh#2, lines#24, lw#8, nlab#8, wsl#80,
        acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
        bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,
-       clear=\E[H\E[J, cnorm=\E[?25h\E[?12l, cr=^M,
+       clear=\E[H\E[J, cnorm=\E[?25h, cr=^M,
        csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
        cud=\E[%p1%dB, cud1=\E[B, cuf=\E[%p1%dC, cuf1=\E[C,
        cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
@@ -11601,7 +11619,7 @@
        cols#80, it#8, lh#2, lines#24, lw#8, nlab#8, wsl#80,
        acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
        bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,
-       clear=\E[H\E[J, cnorm=\E[?25h\E[?12l, cr=^M,
+       clear=\E[H\E[J, cnorm=\E[?25h, cr=^M,
        csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
        cud=\E[%p1%dB, cud1=\E[B, cuf=\E[%p1%dC, cuf1=\E[C,
        cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,
@@ -11653,7 +11671,7 @@
        cols#80, it#8, lh#2, lines#60, lm#0, lw#8, nlab#24, wsl#80,
        acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
        bel=^G, blink=\E[5m, bold=\E[1m, cbt=\E[Z, civis=\E[?25l,
-       clear=\E[H\E[J, cnorm=\E[?25h\E[?12l, cr=^M,
+       clear=\E[H\E[J, cnorm=\E[?25h, cr=^M,
        csr=\E[%i%p1%d;%p2%dr, cub=\E[%p1%dD, cub1=^H,
        cud=\E[%p1%dB, cud1=\E[B, cuf=\E[%p1%dC, cuf1=\E[C,
        cup=\E[%i%p1%d;%p2%dH, cuu=\E[%p1%dA, cuu1=\E[A,

Attachment: pgpH9juNVQLAb.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]