Re: ncurses addch: how to get "normal" newline behavior?



Grant Edwards <grante@xxxxxxxx> wrote:
Is there anyway to get addch() to treat a linefeed character
like a normal terminal does? Instead of linefeed being treated
as an EOL+return+linefeed sequence, I'd like a linefeed to be
just a linefeed.

something like (untested - different logic needed if the window can scroll)


int addexact(int ch)
{
int result;

if (ch == '\n') {
int y, x;
getyx(stdscr, y, x);
result = wmove(stdscr, y + 1, x);
} else {
result = addch(ch);
}
return result;
}

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net
.