I have setup scripts that use the dialog command. They are used to prepare embedded servers. I'd like to display a picture on a edge while a dialog script is running. The problem is, that dialog by design effectively "flushes" what it on the screen and thus removes what was drawn on the framebuffer.

I think there might be a way to display the picture while running a such a script since e.g. some distros show a few tux penguins when booting up while displaying the boot log under them. So something like that would be nice: a picture on the top and a useable dialog under that.

But I don't want that new embedded servers differ from existing ones and I don't want to change existing ones, so e.g. kernel recompilation or installing new software is out of question.


This sounds like the switch to/from alternate screen. You can suppress that using the --keep-tite option:

When built with ncurses, dialog normally checks to see if it is running in an xterm, and in that case tries to suppress the initialization strings that would make it switch to the alternate screen. Switching between the normal and alternate screens is visually distracting in a script which runs dialog several times. Use this option to allow dialog to use those initialization strings.

Alternatively, you could use the LINES environment variable to ask ncurses to not write text on the lower lines of a screen (by telling it that there are fewer lines than actually exist). That will stop it from writing text on those lines, though the effect of clearing-operations on an image is something you'd have to experiment with to see if it is useful (since the framebuffer features are mostly undocumented). Setting COLUMNS might also seem to be useful, but that doesn't work well in practice since ncurses uses text-wrapping which wouldn't look good if the value is incorrect.

  • 1
    I don't think that the linux virtual terminal (whether text-mode or framebuffer) has any support for switching to and from an alternate screen. I may be wrong, but I think that the OP is after something like "force an ncurses app to use only part of the screen". – mosvy Dec 26 '19 at 5:35
  • The system has no xserver and I would like to display something on the framebuffer while a dialog is running so alternate screen doesn't sound that useful. The LINES and COLUMNS environment variables sound useful. Do they work with dialog? I will try that later. – Hans Müller Dec 27 '19 at 10:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.