Terminal – How to Fix Skipping Characters in Linux Terminal

ncursesterminal

In some console applications my Linux server has started "stripping" certain repeating characters, affecting the user interface significantly.

Here are a few examples:

htop view with uneven columns and CPU graphs This htop view has inconsistently sized CPU graphs and inconsistent columns.

iptraf-ng view with uneven columns iptraf-ng main menu with box characters missing
These iptraf-ng views show the menu box characters not being "filled out" and the columns in a live view not being even.

A few points:

  1. This only happens on PuTTY on Windows and the Cygwin (mintty) shell on Windows, confirmed. I haven't tested if it happens on Mac OS X Terminal. It does NOT happen at the local console.
  2. It does not occur if you SSH to the machine from another Linux text console.
  3. My high-level suspicion is that this has something to do with terminal types. However, another Linux server I have does not exhibit this behavior on PuTTY or Cygwin. Both of them report $TERM as being set to xterm.
  4. I've tried reinstalling ncurses on the server in question, which should have also refreshed the terminfo files, with no resolution.
  5. Both machines – both the one working fine and the one exhibiting this behavior – are using en_US.UTF-8 as the locale (the LANG variable). Both have had locale.gen executed recently.
  6. Apps exhibiting this behavior all seem to be curses-based apps. Pure terminal apps are fine.

If it is relevant, both systems are Arch Linux 64-bit, with all current patches applied.

Can someone help pinpoint/solve the is

Best Answer

This is triggered by a recent change in the terminfo database (part of ncurses) denoting that TERM=xterm (and variants) support the REP (repeat previous character) escape sequence, which several terminal emulators other than xterm don't (yet), or just have added / soon will add support.

See e.g. the Konsole or gnome-termial bugreports for further details.

Related Question