I have noticed that when I print line in ncurses that takes more than number of terminal columns ncurses adds newline:
#include <ncurses.h>
int main()
{
initscr(); /* Start curses mode */
printw("Hello World aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa!!!");
refresh(); /* Print it on to the real screen */
getch(); /* Wait for user input */
endwin(); /* End curses mode */
return 0;
}
Now as the terminal has less columns my output looks like this:
Hello World aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa!!!
In my app I wan't to copy terminal output but when I do so I'm getting newline where line breaks but I didn't putted any new line when calling printw. Does ncurses add newlines automatically? How I can disable that? This is simple version of my problem as In my case I'm using mvwaddnwstr to print wide characters but problem stays.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.