I have the same version of ncurses on the same distro (Debian) on my desktop. And that program worked fine in the pure terminal mode as well as in an X terminal on my desktop system.
Is there a problem with the pure text mode in laptops which cause this issue. Or is the code the problem? Here's the code:
/* Finishing up the ncurses proram */
static void finish (int sig)
/* Do some initializing for ncurses terminal mode */
void initialize ()
signal (SIGINT, finish);
if (has_colors ())
init_pair (1, COLOR_WHITE, COLOR_BLACK);
init_pair (2, COLOR_WHITE, COLOR_BLUE);
/* Main program loop */
void main_loop ()
char* window_title = " poorty - not fortune ";
int x, y;
getmaxyx (stdscr, y, x);
box (stdscr, 0, 0);
mvaddstr (0, x/2 - strlen(window_title)/2, window_title);
int ch = getch ();
int main ()
// Initialize the curses terminal
// Main program loop
// Clean up on terminate
In pure text mode, this program doesn't draw the border correct around the whole terminal and the text is displayed in the wrong location (not at the centre of the first line).
NOTE: the program is not yet complete. It's supposed to display a random quote.