1
#include <ncurses.h>
int main() {
    initscr();
    cbreak();
    noecho();
    //  6 xs
    printw("xxxxxxx");
    getch();
    endwin();

    return 0;
}

Prints

xxxxxx

If I add just one more x to the printw statement only

x

is printed. Why?

OS: Arch Linux

$ echo $TERM
xterm-256color
Jens
  • 69,818
  • 15
  • 125
  • 179
ps-aux
  • 11,627
  • 25
  • 81
  • 128
  • 1
    Cannot reproduce here (I get 7 `x`). This is on what OS, using which terminal? – dhke Dec 14 '17 at 19:38
  • Solved by `putenv("TERM=vte")` based on https://stackoverflow.com/questions/46162793/different-ncurses-behaviours-with-different-terminals – ps-aux Dec 18 '17 at 09:39
  • Even though I marked the question as solved I would still be interested in the reason of this behavior. – ps-aux Dec 18 '17 at 09:41

0 Answers0