Reputation: 70
I am writing a program, using ncurses, that outputs a very wide table. I would not like to cut off or wrap the table when the terminal window is too small.
Is there any possibility to force the scroll bars to appear when the window is too small? Or can I set a fixed size for the terminal window and disable changing its size by the user?
I use Linux/Ubuntu and gnome-terminal.
Upvotes: 0
Views: 1432
Reputation: 2256
Take a look at the "pad" demo in the "ncurses" program in ncurses' "test" folder. It's a pretty smooth implementation of a scrollable window implemented within curses. That's the route I'd suggest.
But, there are escape sequences to resize some terminals, including gnome-terminal. Note, there are no curses functions to generate these sequences. Doing this takes you outside the realm of curses. For example: Xterm terminal and resize code
Upvotes: 2