1

I am starting to learn how to use ncurses right now, and I do some calculations based on the number of lines and columns when the program starts.

It would be too much work for me to do dynamic calculation to manage the display, so I would need to find a way to block the resize of the shell during the execution, is this possible ?

Swann
  • 2,413
  • 2
  • 20
  • 28
  • If you use PDCurses, you could compile and link to the SDL Version. Using SDL should theoretically give you the ability to create a non-resizable window for your output. This means your application would basically provide its own terminal window rather than XTerm or Windows Cmd.exe. – Brandin Feb 03 '14 at 15:17

1 Answers1

0

There is certainly no portable or general-purpose way of blocking display size changes. Specific terminal emulators might offer this feature, but I don't know of any which do. It is generally possible to create a window of fixed size, but the terminal emulator would have to do that; it is invisible to the console code running inside the terminal.

If you find it difficult to respond to dynamic display size changes, you probably need to restructure your code. Otherwise, you can just ignore the size change, which might result in a confusing experience for your users, or might just result in them seeing either a portion of the output or a lot of blank space, depending on the nature of the resizing. (To get the latter effect, you need to avoid relying on automatic line wrapping and scrolling. On the other hand, automatic wrapping and scrolling are often just what you need to make your application window-size-independent.)

rici
  • 234,347
  • 28
  • 237
  • 341