Hello, I discovered NCURSES_NO_MAGIC_COOKIE, which lets me workaround the issue without having to recompile the library!
Given that, I decided to write some python to determine which other TERM types might be affected. I tested the sample code with all the terminal types in an 80x24 window on Slackware64-15.0 There are 95 terminal types which give a much larger output when running with magic cookie support turned on, and they all have a xmc entry in terminfo. (See table 1 for the numbers) There are also some terminal types which are unaffected by the magic cookie setting, even though they have an xmc entry in terminfo. (See table 2 for these) The rest of the terminals that didn't make the tables fall into 2 categories: Cannot open that terminal type or Unaffected by magic cookie and have no xmc entry in terminfo. You are welcome to the ugly python code that I used to make the tables, if it helps. -Frank On Thu, May 14, 2026 at 4:02 AM Thomas Dickey <[email protected]> wrote: > On Wed, May 13, 2026 at 09:42:12PM -0400, Frank Palazzolo wrote: > > Hello, > > > > I discovered an issue with ncurses on Slackware, both version 6.3 used in > > Slackware 15.0 and 6.6 used in Slackware-current. I was testing a real > > serial terminal - a Tandy DT-1 set to emulate a tvi910. > > tvi910|TeleVideo model 910, > am, msgr, > cols#80, it#8, lines#24, xmc#1, > ^^^^^ > bel=^G, cbt=\EI, clear=^Z, cr=\r, cub1=^H, cud1=\n, cuf1=^L, > cup=\E=%p1%' '%+%c%p2%' '%+%c, cuu1=^K, ed=\EY, el=\ET, > home=\E=^A^A, hpa=\E]%p1%' '%+%c, ht=^I, > if=/usr/local/ncurses/share/tabset/stdcrt, ind=\n, > invis@, kbs=^H, kcub1=^H, kcud1=\n, kcuf1=^L, kcuu1=^K, > kf0=^AI\r, kf1=^A@\r, kf2=^AA\r, kf3=^AB\r, kf4=^AC\r, > kf5=^AD\r, kf6=^AE\r, kf7=^AF\r, kf8=^AG\r, kf9=^AH\r, > khome=^^, rev=\EG4, rmso=\EG0, rmul=\EG0, sgr0=\EG0, > smso=\EG4, smul=\EG8, vpa=\E[%p1%' '%+%c, > > > > It turns out that, for all ncurses apps, with TERM=tvi910 I get a bunch > of > > spaces being printed all the time, instead of optimized cursor > movement. I > > tried the same configuration on Debian 13 (trixie) as well as arch, and > > these work fine. So I started to suspect the issue is something specific > > to the configure options used by Slackware. I tested some other terminal > > types, vt100 and adm3a, and they seem to be unaffected. > > > > I have written a trivial test program here: > > https://github.com/palazzol/ncurses_test > > And, I think I have narrowed it down to the configure option > > --enable-wmc-glitch option, which Slackware uses. It seems like this > > --enable-xmc-glitch > Compile-in support experimental xmc (magic cookie) code. > ^^^^^^^^^^^^ > > > causes the bad behavior with this terminal type. If I rebuild ncurses > > without that, everything works fine. > > > > Is this kind of dramatic failure expected when using that option? I see > it > > is marked as "experimental". I'm honestly not sure if my trace has > > captured the root cause yet, but you can see that the test program > > generates <100 bytes when working properly, or >2K bytes when not. > > I'd expect xmc-glitch to do "something" if there were video attributes, > and otherwise not much (and your example doesn't do that), so it sounds > like code rot which I can probably fix. It's been a long time since that > feature was changed - from trying to get some clone of hpterm to run :-( > > -- > Thomas E. Dickey <[email protected]> > https://invisible-island.net >
TABLE 1: TERM noxmc xmc --------------------------- adm5 : 29 1935 xmcline:cols#80, lines#24, xmc#1, ampex232 : 27 1939 xmcline:cols#80, lines#24, xmc#1, adm21 : 30 1942 xmcline:cols#80, lines#24, xmc#1, abm85 : 30 1944 xmcline:cols#80, it#8, lines#24, xmc#1, adm1178 : 26 1932 xmcline:cols#80, lines#24, xmc#1, ampex210 : 27 2031 xmcline:cols#80, it#8, lines#24, xmc#1, ampex232w : 27 1939 xmcline:cols#132, lines#24, xmc#1, osexec : 27 1937 xmcline:cols#80, lines#24, xmc#1, OTug#1, sb2 : 57 1973 xmcline:cols#80, lines#25, xmc#1, sbi : 57 1973 xmcline:cols#80, lines#25, xmc#1, sb1 : 57 1973 xmcline:cols#80, lines#25, xmc#1, f1720 : 39 2038 xmcline:cols#80, lines#16, xmc#1, zen50 : 27 1939 xmcline:cols#80, lines#24, xmc#1, prism7 : 117 2023 xmcline:cols#80, lines#24, xmc#1, wsl#72, prism9-8 : 117 2031 xmcline:cols#80, lines#24, xmc#1, wsl#72, prism14-m-w : 117 2031 xmcline:cols#132, lines#24, xmc#1, wsl#72, prism14-m : 117 2031 xmcline:cols#80, lines#24, xmc#1, wsl#72, prism12-m-w : 117 2031 xmcline:cols#132, lines#24, xmc#1, wsl#72, prism4 : 111 2017 xmcline:cols#80, lines#24, xmc#1, wsl#72, p8gl : 32 1938 xmcline:cols#80, lines#24, xmc#1, ma#1, wsl#78, prism12-m : 117 2031 xmcline:cols#80, lines#24, xmc#1, wsl#72, prism9-8-w : 117 2031 xmcline:cols#132, lines#24, xmc#1, wsl#72, prism8-w : 117 2023 xmcline:cols#132, lines#24, xmc#1, wsl#72, prism5 : 111 2017 xmcline:cols#80, lines#24, xmc#1, wsl#72, pe1251 : 1444 3350 xmcline:cols#80, it#8, lines#24, xmc#1, pb#300, vt#8, prism8 : 117 2023 xmcline:cols#80, lines#24, xmc#1, wsl#72, ims950-b : 29 1943 xmcline:cols#80, it#8, lines#24, xmc#1, ims950 : 29 1943 xmcline:cols#80, it#8, lines#24, xmc#1, ims950-rv : 29 1943 xmcline:cols#80, it#8, lines#24, xmc#1, intext : 591 2526 xmcline:cols#80, it#8, lines#24, xmc#1, hp700-wy : 70 1984 xmcline:cols#80, it#8, lines#24, xmc#1, contel300 : 31 1943 xmcline:cols#80, lines#24, xmc#1, contel301 : 31 1937 xmcline:cols#80, lines#24, xmc#1, wy350-wvb : 55 1969 xmcline:cols#132, lh#1, lw#7, lines#24, xmc#1, colors#8, pairs#8, ncv#55, wy30-mc : 37 1951 xmcline:cols#80, lh#1, lw#8, lines#24, xmc#1, ma@, nlab#8, wsl#45, wy50-mc : 37 1951 xmcline:cols#80, lh#1, lw#8, lines#24, xmc#1, ma@, nlab#8, wsl#45, wy350-vb : 48 1962 xmcline:cols#80, lh#1, lw#8, lines#24, xmc#1, colors#8, pairs#8, ncv#55, wy75-mc : 61 2131 xmcline:cols#80, lines#24, xmc#1, ma@, pb#1201, wsl#78, wy100 : 29 2028 xmcline:cols#80, lines#24, xmc#1, wy350-w : 55 1969 xmcline:cols#132, lh#1, lw#7, lines#24, xmc#1, colors#8, pairs#8, ncv#55, wy350 : 48 1962 xmcline:cols#80, lh#1, lw#8, lines#24, xmc#1, colors#8, pairs#8, ncv#55, wy100q : 28 2027 xmcline:cols#80, lines#24, xmc#1, xterm-xmc : 99 2169 xmcline:# Reconstructed via infocmp from file: /usr/share/terminfo/x/xterm-xmc xtalk : 56 1973 xmcline:cols#80, it#8, lines#24, xmc#1, vt#3, qvt101 : 26 1938 xmcline:cols#80, lines#24, xmc#1, qvt102 : 26 1938 xmcline:cols#80, lines#24, xmc#1, tvi912b-vb-mc : 906 2946 xmcline:cols#80, it#8, lines#24, xmc#1, tvi925 : 26 1938 xmcline:cols#80, lines#24, xmc#1, tvi803 : 29 2035 xmcline:cols#80, it#8, lines#24, xmc#1, tvi950-rv : 29 2035 xmcline:cols#80, it#8, lines#24, xmc#1, tvi912b-2p-mc : 906 2946 xmcline:cols#80, it#8, lines#24, xmc#1, tvi910 : 26 1932 xmcline:cols#80, it#8, lines#24, xmc#1, t1061 : 33 1945 xmcline:cols#80, it#8, lines#24, xmc#1, t10 : 158 2157 xmcline:cols#80, it#8, lines#24, xmc#2, tvi920b-vb-mc : 906 2946 xmcline:cols#80, it#8, lines#24, xmc#1, tvi950 : 29 2035 xmcline:cols#80, it#8, lines#24, xmc#1, tvi920b-mc : 246 2286 xmcline:cols#80, it#8, lines#24, xmc#1, tvi912b-mc : 246 2286 xmcline:cols#80, it#8, lines#24, xmc#1, tvi950-4p : 47 2053 xmcline:cols#80, it#8, lines#24, xmc#1, tvi920b-2p-mc : 906 2946 xmcline:cols#80, it#8, lines#24, xmc#1, tvi950-rv-2p : 47 2053 xmcline:cols#80, it#8, lines#24, xmc#1, tvi910+ : 26 1938 xmcline:cols#80, it#8, lines#24, xmc#1, t1061f : 33 1945 xmcline:cols#80, it#8, lines#24, xmc#1, tvi912 : 27 1939 xmcline:cols#80, it#8, lines#24, xmc#1, tvi950-2p : 47 2053 xmcline:cols#80, it#8, lines#24, xmc#1, tandem653 : 25 1931 xmcline:cols#80, lines#24, xmc#1, wsl#64, tvi950-rv-4p : 47 2053 xmcline:cols#80, it#8, lines#24, xmc#1, tvi912b+mc : 1944 3851 xmcline:xmc#1, tek4023 : 41 1947 xmcline:cols#80, lines#24, xmc#1, OTdN#4, vt#4, ncr7900i : 26 1932 xmcline:cols#80, lines#24, xmc#1, ncr260wy50+wpp : 42 1955 xmcline:cols#132, lines#24, xmc#1, nlab#32, ncr260wy350wpp : 45 1958 xmcline:cols#132, lines#24, xmc#1, colors#16, pairs#16, ncv#33, ncr160wy50+wpp : 42 1955 xmcline:cols#132, lines#24, xmc#1, nlab#32, ncr160wy50+pp : 35 1948 xmcline:cols#80, lines#24, xmc#1, nlab#32, ncr260wy50+pp : 35 1948 xmcline:cols#80, lines#24, xmc#1, nlab#32, ncr260wy350pp : 38 1951 xmcline:cols#80, lines#24, xmc#1, colors#16, pairs#16, ncv#33, nlab#32, ncr160vppp : 31 1945 xmcline:cols#80, lines#24, xmc#1, nlab#32, ndr9500-25-mc : 34 1948 xmcline:cols#80, lines#25, xmc#1, wsl#79, ncr260vppp : 31 1945 xmcline:cols#80, lines#24, xmc#1, nlab#32, ncr260vpwpp : 38 1952 xmcline:cols#132, lines#24, xmc#1, nlab#32, ncr160vpwpp : 38 1952 xmcline:cols#132, lines#24, xmc#1, nlab#32, ndr9500-mc : 34 1948 xmcline:cols#80, lines#24, xmc#1, wsl#79, ndr9500-mc-nl : 34 1948 xmcline:cols#80, lines#24, xmc#1, wsl@, ndr9500-25-mc-nl: 34 1948 xmcline:cols#80, lines#25, xmc#1, regent100 : 26 1932 xmcline:cols#80, lines#24, xmc#1, regent60 : 28 1942 xmcline:cols#80, lines#24, xmc#1, regent40+ : 26 1932 xmcline:cols#80, lines#24, xmc#1, regent40 : 26 1932 xmcline:cols#80, lines#24, xmc#1, vt100-nav-w : 63 2133 xmcline:cols#132, it#8, lines#14, xmc#1, vt#3, viewdata-rv : 38 1939 xmcline:cols#40, lines#24, xmc#1, vt100-nav : 63 2133 xmcline:cols#80, it#8, lines#24, xmc#1, vt#3, vp60 : 26 1932 xmcline:cols#80, lines#24, xmc#1, dt100 : 49 2048 xmcline:cols#80, lines#24, xmc#1, dt100w : 49 2048 xmcline:cols#132, lines#24, xmc#1, dku7003 : 34 1987 xmcline:cols#80, lines#25, xmc#1, TABLE 2: TERM noxmc==xmc ---------------------- altos7 : 30 xmcline:cols#80, lines#24, xmc#0, adm5 : 29 xmcline:cols#80, lines#24, xmc#1, altos2 : 44 xmcline:cols#80, it#8, lines#24, xmc#0, altos3 : 44 xmcline:cols#80, it#8, lines#24, xmc#0, abm85h-old : 30 xmcline:cols#80, it#8, lines#24, xmc@, altos7pc : 30 xmcline:cols#80, lines#24, xmc#0, abm85e : 30 xmcline:cols#80, it#8, lines#24, xmc@, ampex232 : 27 xmcline:cols#80, lines#24, xmc#1, adm21 : 30 xmcline:cols#80, lines#24, xmc#1, awsc : 33 xmcline:cols#80, lines#24, xmc#0, OTug#0, abm85 : 30 xmcline:cols#80, it#8, lines#24, xmc#1, adm1178 : 26 xmcline:cols#80, lines#24, xmc#1, ampex210 : 27 xmcline:cols#80, it#8, lines#24, xmc#1, aws : 35 xmcline:cols#80, lines#28, xmc#0, OTug#0, abm85h : 31 xmcline:cols#80, it#8, lines#24, xmc@, ampex232w : 27 xmcline:cols#132, lines#24, xmc#1, osexec : 27 xmcline:cols#80, lines#24, xmc#1, OTug#1, sb2 : 57 xmcline:cols#80, lines#25, xmc#1, sbi : 57 xmcline:cols#80, lines#25, xmc#1, sb1 : 57 xmcline:cols#80, lines#25, xmc#1, f1720 : 39 xmcline:cols#80, lines#16, xmc#1, zen50 : 27 xmcline:cols#80, lines#24, xmc#1, prism7 : 117 xmcline:cols#80, lines#24, xmc#1, wsl#72, prism9-8 : 117 xmcline:cols#80, lines#24, xmc#1, wsl#72, prism14-m-w : 117 xmcline:cols#132, lines#24, xmc#1, wsl#72, prism14-m : 117 xmcline:cols#80, lines#24, xmc#1, wsl#72, prism12-m-w : 117 xmcline:cols#132, lines#24, xmc#1, wsl#72, prism4 : 111 xmcline:cols#80, lines#24, xmc#1, wsl#72, p8gl : 32 xmcline:cols#80, lines#24, xmc#1, ma#1, wsl#78, prism12-m : 117 xmcline:cols#80, lines#24, xmc#1, wsl#72, prism9-8-w : 117 xmcline:cols#132, lines#24, xmc#1, wsl#72, prism8-w : 117 xmcline:cols#132, lines#24, xmc#1, wsl#72, prism5 : 111 xmcline:cols#80, lines#24, xmc#1, wsl#72, pe1251 : 1444 xmcline:cols#80, it#8, lines#24, xmc#1, pb#300, vt#8, prism8 : 117 xmcline:cols#80, lines#24, xmc#1, wsl#72, bobcat : 96 xmcline:cols#128, it#8, lines#47, xmc#0, ims950-b : 29 xmcline:cols#80, it#8, lines#24, xmc#1, ims950 : 29 xmcline:cols#80, it#8, lines#24, xmc#1, ims950-rv : 29 xmcline:cols#80, it#8, lines#24, xmc#1, intext2 : 46 xmcline:cols#80, lines#24, xmc#0, intext : 591 xmcline:cols#80, it#8, lines#24, xmc#1, hp2 : 52 xmcline:cols#80, lh#2, lw#8, lines#24, lm#0, xmc#0, nlab#8, hp98550-color : 62 xmcline:cols#128, it#8, lh#2, lw#8, lines#49, lm#0, xmc#0, colors#8, hpterm : 52 xmcline:cols#80, lh#2, lw#8, lines#24, lm#0, xmc#0, nlab#8, pb#9600, hpterm-color : 52 xmcline:cols#80, lh#2, lw#8, lines#24, lm#0, xmc#0, colors#64, pairs#8, hpterm-color2 : 62 xmcline:cols#80, it#8, lh#2, lw#8, lines#24, lm#0, xmc#0, colors#8, hp300h : 51 xmcline:cols#128, lines#51, lm#0, xmc#0, hp700-wy : 70 xmcline:cols#80, it#8, lines#24, xmc#1, contel300 : 31 xmcline:cols#80, lines#24, xmc#1, contel301 : 31 xmcline:cols#80, lines#24, xmc#1, wy350-wvb : 55 xmcline:cols#132, lh#1, lw#7, lines#24, xmc#1, colors#8, pairs#8, ncv#55, wy30-mc : 37 xmcline:cols#80, lh#1, lw#8, lines#24, xmc#1, ma@, nlab#8, wsl#45, wy50-mc : 37 xmcline:cols#80, lh#1, lw#8, lines#24, xmc#1, ma@, nlab#8, wsl#45, wy350-vb : 48 xmcline:cols#80, lh#1, lw#8, lines#24, xmc#1, colors#8, pairs#8, ncv#55, wy75-mc : 61 xmcline:cols#80, lines#24, xmc#1, ma@, pb#1201, wsl#78, wy100 : 29 xmcline:cols#80, lines#24, xmc#1, wy350-w : 55 xmcline:cols#132, lh#1, lw#7, lines#24, xmc#1, colors#8, pairs#8, ncv#55, wy350 : 48 xmcline:cols#80, lh#1, lw#8, lines#24, xmc#1, colors#8, pairs#8, ncv#55, wy100q : 28 xmcline:cols#80, lines#24, xmc#1, xterm-xmc : 99 xmcline:# Reconstructed via infocmp from file: /usr/share/terminfo/x/xterm-xmc xtalk : 56 xmcline:cols#80, it#8, lines#24, xmc#1, vt#3, qvt119+-25 : 30 xmcline:cols#80, lines#25, xmc#0, qvt101 : 26 xmcline:cols#80, lines#24, xmc#1, qvt119+ : 30 xmcline:cols#80, lines#24, xmc#0, qvt101+ : 26 xmcline:cols#80, lines#24, xmc#0, qvt119+-25-w : 30 xmcline:cols#80, lines#25, xmc#0, qvt119+-w : 30 xmcline:cols#132, lines#24, xmc#0, qvt102 : 26 xmcline:cols#80, lines#24, xmc#1, tvi925-hi : 26 xmcline:cols#80, lines#24, xmc@, tvi912b-vb-mc : 906 xmcline:cols#80, it#8, lines#24, xmc#1, tvi925 : 26 xmcline:cols#80, lines#24, xmc#1, tvi803 : 29 xmcline:cols#80, it#8, lines#24, xmc#1, tvi950-rv : 29 xmcline:cols#80, it#8, lines#24, xmc#1, tvi912b-2p-mc : 906 xmcline:cols#80, it#8, lines#24, xmc#1, tvi910 : 26 xmcline:cols#80, it#8, lines#24, xmc#1, tvi921 : 50 xmcline:cols#80, lines#24, xmc#0, t1061 : 33 xmcline:cols#80, it#8, lines#24, xmc#1, t10 : 158 xmcline:cols#80, it#8, lines#24, xmc#2, tvi92D : 50 xmcline:cols#80, lines#24, xmc#0, tvi920b-vb-mc : 906 xmcline:cols#80, it#8, lines#24, xmc#1, tvi950 : 29 xmcline:cols#80, it#8, lines#24, xmc#1, tvi920b-mc : 246 xmcline:cols#80, it#8, lines#24, xmc#1, tvi912b-mc : 246 xmcline:cols#80, it#8, lines#24, xmc#1, tvi950-4p : 47 xmcline:cols#80, it#8, lines#24, xmc#1, tvi92B : 50 xmcline:cols#80, lines#24, xmc#0, tvi924 : 32 xmcline:cols#80, it#8, lines#24, xmc#0, wsl#80, tvi920b-2p-mc : 906 xmcline:cols#80, it#8, lines#24, xmc#1, tvi950-rv-2p : 47 xmcline:cols#80, it#8, lines#24, xmc#1, tvi910+ : 26 xmcline:cols#80, it#8, lines#24, xmc#1, t1061f : 33 xmcline:cols#80, it#8, lines#24, xmc#1, tvi955 : 46 xmcline:cols#80, it#8, lines#24, xmc@, tvi912 : 27 xmcline:cols#80, it#8, lines#24, xmc#1, tvi950-2p : 47 xmcline:cols#80, it#8, lines#24, xmc#1, tandem653 : 25 xmcline:cols#80, lines#24, xmc#1, wsl#64, tvi950-rv-4p : 47 xmcline:cols#80, it#8, lines#24, xmc#1, tvi912b+mc : 1944 xmcline:xmc#1, tek4023 : 41 xmcline:cols#80, lines#24, xmc#1, OTdN#4, vt#4, ncr7900i : 26 xmcline:cols#80, lines#24, xmc#1, ncr260wy50+wpp : 42 xmcline:cols#132, lines#24, xmc#1, nlab#32, ncr260wy350wpp : 45 xmcline:cols#132, lines#24, xmc#1, colors#16, pairs#16, ncv#33, ncr160wy50+wpp : 42 xmcline:cols#132, lines#24, xmc#1, nlab#32, ncr160wy50+pp : 35 xmcline:cols#80, lines#24, xmc#1, nlab#32, ncr260wy50+pp : 35 xmcline:cols#80, lines#24, xmc#1, nlab#32, ncr260wy350pp : 38 xmcline:cols#80, lines#24, xmc#1, colors#16, pairs#16, ncv#33, nlab#32, ncr160vppp : 31 xmcline:cols#80, lines#24, xmc#1, nlab#32, ndr9500-25-mc : 34 xmcline:cols#80, lines#25, xmc#1, wsl#79, ncr260vppp : 31 xmcline:cols#80, lines#24, xmc#1, nlab#32, ncr260vpwpp : 38 xmcline:cols#132, lines#24, xmc#1, nlab#32, ncr160vpwpp : 38 xmcline:cols#132, lines#24, xmc#1, nlab#32, ndr9500-mc : 34 xmcline:cols#80, lines#24, xmc#1, wsl#79, ndr9500-mc-nl : 34 xmcline:cols#80, lines#24, xmc#1, wsl@, ndr9500-25-mc-nl: 34 xmcline:cols#80, lines#25, xmc#1, regent100 : 26 xmcline:cols#80, lines#24, xmc#1, regent60 : 28 xmcline:cols#80, lines#24, xmc#1, regent40+ : 26 xmcline:cols#80, lines#24, xmc#1, regent40 : 26 xmcline:cols#80, lines#24, xmc#1, vt100-nav-w : 63 xmcline:cols#132, it#8, lines#14, xmc#1, vt#3, viewdata-rv : 38 xmcline:cols#40, lines#24, xmc#1, vt100-nav : 63 xmcline:cols#80, it#8, lines#24, xmc#1, vt#3, vp60 : 26 xmcline:cols#80, lines#24, xmc#1, m2-nam : 49 xmcline:cols#80, it#8, lines#24, xmc#0, wsl#72, dt100 : 49 xmcline:cols#80, lines#24, xmc#1, dt100w : 49 xmcline:cols#132, lines#24, xmc#1, dku7003 : 34 xmcline:cols#80, lines#25, xmc#1,
