0

I recently rebuilt my Atton Emacs Editor on ArchLinux. All works fine but when logged in via a remove ssh session I have noticed that some parts of the display dont update correctly. I have narrowed this down to the behaviour of addch() when used in a loop. The following code should print 60 * on the first line of the window, but only 1 * is displayed. If you set the loop to only 6 it will print 6*s. It appears that callig addch() in a loop floods a buffer somewhere in the stack.

#include <curses.h>

int main(void)
{
        int i=1;
        initscr();
        move(0,0);

        for (i = 1; i <= 60; i++)
                addch('*');

        refresh();
        getch();
        endwin();
}

Anyone any ideas how to make this work without having to add lots of coding to work round it ?

hughb
  • 1
  • 1
    Does this answer your question? [how to get a correctly sized window in ncurses](https://stackoverflow.com/questions/51904557/how-to-get-a-correctly-sized-window-in-ncurses) – Thomas Dickey Dec 12 '20 at 00:42
  • The link pointed to a suggestion that different TERM types could not handle repeated characters. I am logging in via the same ssh client on a chromebook. On Elimentary OS, echo $TERM responds xterm-256color and the same on Arch. However I only get the problem on the Arch login. Possibly something to so with the way ssh is setup, though the instructions were basically the same for each OS. Putting refresh() in the loop after every 5 chars works but that is a hack. – hughb Dec 26 '20 at 22:43
  • "*different TERM types" is irrelevant: the relevant issue is the terminal **program**. – Thomas Dickey Dec 27 '20 at 01:38

0 Answers0