tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

curses: addstr() does ignore tab characters



Hello,

addstr() does ignore tab characters but printw() doesn't.  For both functions I would expect that they output tabs as such.  A small example source code is:

$ cat main.c                                                                                                                                                                                   
#include <curses.h>

int
main()
{
        initscr();
        addstr("add\tstr\n");
        printw("print\tw\n");
        refresh();
        getch();
        endwin();
        return 0;
}

When compiled and started with

$ cc main.c -lcurses                                                                                                                                                                           
$ ./a.out

only printw() outputs the tab.  The '\n' is output by both functions.

--Carsten


Home | Main Index | Thread Index | Old Index