Created attachment 107812 [details] konsole with TERM=xterm (up), TERM=linux (down) and a xterm window (right) After ArchLinux ncurses package update to version 20170902, drawing boxes in konsole using ncurses' 'box()' function is broken for TERM env variable set to xterm and its variants. As far as I've found, it seems to be related to a change in terminfo.src: # 2017-07-29 # + add "rep" to xterm-new, available since 1997/01/26 -TD < http://invisible-island.net/ncurses/terminfo.src.html#t20170729 > Konsole seems to be lacking `rep` command support. Steps to reproduce: 0. Ensure you have the latest versions of ncurses and terminfo database. 1. Copy and paste example ncurses program's source from http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/windows.html#LETBEWINDOW into a file 2. Compile it, eg.: gcc -lncurses -o boxtest boxtest.c 3. Run it, eg. ./boxtest 4. Rendered box (10 columns wide) is broken: its first and last row has only 3 columns; see attached screenshot In konsole-17.08.1 box is rendered broken. xterm-330 displays the box properly; TERM variable set to 'xterm', 'xterm-256color', 'linux', no difference, rendering always works. rxvt-unicode-9.22 with TERM=xterm renders the box *broken*. After changing the `TERM` env variable to, for e.g. 'linux' or 'rxvt', konsole starts to render the box properly. My locale: LANG=pl_PL.UTF-8 With my distro's previous version of the terminfo (2017-05-13), konsole rendered box()-es ok. Attached a screenshot: konsole with TERM=xterm (up), TERM=linux(down) and a xterm
Created attachment 107813 [details] terminfo entries Terminfo entries from the working and broken versions: compiled files and infocmp dumps
Might be fixed with newer ncurses though. There have been changes since 2017-07-29 ... ;-) E.g. ncurses patch 20170827: + fix a bug in repeat_char logic (cf: 20170729, report by Chris Clayton). See also http://bugzilla.opensuse.org/show_bug.cgi?id=1054448, which sounds similar to your problem.
PS, noticed now that you acually have version 20170902, but the confirmed "fixed" one mentioned in the openSUSE bug report is 20170909...
Nope, still broken. Downloaded the new version (20170909), compiled it locally, replaced the whole terminfo database, and no change. The example program is still rendered wrong, as with the 20170902 version. There is no changes between versions in the xterm-256color terminfo file: athantor@athantor /tmp/ncurses-6.0-20170909 $ md5sum /tmp/nc20170909/usr/share/terminfo/x/xterm-256color /usr/share/terminfo/x/xterm-256color a8db78a6f0ea1b480f6bd2198ed8f315 /tmp/nc20170909/usr/share/terminfo/x/xterm-256color a8db78a6f0ea1b480f6bd2198ed8f315 /usr/share/terminfo/x/xterm-256color athantor@athantor /tmp/ncurses-6.0-20170909 $ l /tmp/nc20170909/usr/share/terminfo/x/xterm-256color /usr/share/terminfo/x/xterm-256color -rw-r--r-- 1 athantor athantor 3587 09-12 16:56 /tmp/nc20170909/usr/share/terminfo/x/xterm-256color -rw-r--r-- 1 root root 3587 09-04 08:13 /usr/share/terminfo/x/xterm-256color athantor@athantor /tmp/ncurses-6.0-20170909 $
Indeed. I upgraded to ncurses 20170909 here (I was using an older version), tried that boxtest example and can reproduce the problem (there are also glitches in htop or alsamixer e.g.). Another workaround is to set TERM=xterm-color btw. Interestingly, it's also (still) broken in gnome-terminal here, although at least one person explicitly wrote in that openSUSE bug report that it works there now. Maybe my version is too old, or he only tested a different issue... (there were several since the upgrade to ncurses 20170729 AFAIK)
I've filed the same bug for gnome-terminal at https://bugzilla.gnome.org/show_bug.cgi?id=787701.
Are there any plans to add the rep feature for a better XTerm emulation of the konsole terminal emluator?
See https://phabricator.kde.org/D10064
The boxtest looks correct on Konsole master using TERM=xterm-256color and TERM=xterm I'm currently testing on neon.kde.org distro Do you have another test that shows the issue?
(In reply to Kurt Hindenburg from comment #9) > I'm currently testing on neon.kde.org distro > > Do you have another test that shows the issue? You need to use a recent ncurses. Versions before 20170729 didn't use REP yet. KDE Neon is based on Ubuntu (16.04?) LTS, so likely has a "too old" ncurses. I tried with the latest one from openSUSE Tumbleweed, the boxtest is broken with both TERM=xterm-256color and TERM=xterm, and https://phabricator.kde.org/D10064 fixes it.
confirmed on openSUSE Tumbleweed
forgot to add to commit message
*** Bug 391170 has been marked as a duplicate of this bug. ***
For those affected till the fix arrives, a work-around is infocmp | sed 's/rep=[^,]*,//' | tic -