Mohammed Farahmand
Mohammed Farahmand

Reputation: 498

NCURSES doesn't show scrollbars in elementryOS terminal

I've been using NCURSES library for my assignment, but there is one big problem with it. I can't make it to show the scrollbars on the terminal window. I've tried anything I found here but none of them seems to work. I found this code portion in StackExhcange but even this doesn't show schrollbars.

#include <ncurses.h>

int main(void)
{
int i = 0;

initscr();

scrollok(stdscr,TRUE);

while(i<500) {
    printw("%3d - lots and lots of lines flowing down the terminal\n", i);
    ++i;
    refresh();
}

getchar();

endwin();
return 0;
}

Is it a problem with elementaryOS because I've heard it's been modified.

Upvotes: 1

Views: 186

Answers (1)

Thomas Dickey
Thomas Dickey

Reputation: 54563

Two possibilities:

  • The terminal description is probably using the xterm alternate screen feature. Some terminals don't display scrollbars when using the alternate screen because scrolling is disabled. For instance, VTE, which is the real terminal you're using by default has (hardcoded) behavior in this mode to translate your scrolling into up/down cursor keys.
  • OP expects curses applications to display scrollbars. They don't, unless the application simulates scrollbars.

For example, dialog does the latter. Here's an example:

screenshot of dialog with simulated scrollbars

Upvotes: 2

Related Questions