Skip to content

Inconsistent console display background on black-on-white terminal emulators #844

Description

@PoC-dev

This issue pertains to at least all SDL-Hercules 4 releases. Only today, I'm taking my time to report it. I admit, it's a low priority, largely cosmetic thing.

If one uses a terminal emulator with black characters on a white background — default setting for the macOS terminal ever since, and consistent with earlier applications such as NCSA telnet in the 1990's — only parts of the screen with actual output are erased and initialized to feature black background:

Image

Note that the color setting on the Mac is not simply "white on black terminal set to reverse video", but the background color is indeed white. I guess that's important to know for duplicating the issue. Also, this happens only when Hercules runs within a screen-session! A combination of screen (4.09.00 (GNU) 30-Jan-22), and Hercules!

I have written an (unrelated) application that uses ncurses to output a full-screen display with black background and initially faced the same issue. Until I found, that the background needs to be set explicitly:

init_pair(CP_GREEN, COLOR_GREEN, COLOR_BLACK);
bkgd(COLOR_PAIR(CP_GREEN));

This application does not show the documented behavior, even within screen.

Note: Ncurses uses predefined color pairs as attributes, which can be switched on and off during program execution.

I have not found any curses initialization routines in the Hercules routines, but termios.h is included. So POSIX terminal interface routines are used.

After some grepping and looking at files, I'm lost. I see panel.c has a function set_panel_colors() and a variable sysblk.pan_colors, but after assembling the puzzle pieces, this seems to be related to this text in the documentation:

MSGCOLOR=DARK displays colorized panel messages meant for 'dark' panels (such as white text on black background) whereas MSGCOLOR=LIGHT is obviously meant for panels using dark text on light backgrounds. Only 'E' (error), 'W' (warning), 'D' (debug) and 'I' (informational) messages are colorized. Any message not detected as a Hercules "HHCnnnnnX" format message are not colorized.

So this is not for the view shown in my screen shot, but for the command entry panel. This strongly hints towards the described screen output is not the result of a configuration issue. 😊

I don't understand how Termios works, so I'm unable to provide a proper patch to set the background color as described above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BUGThe issue describes likely incorrect product functionality that likely needs corrected.HELP!Help is needed from someone more experienced or I'm simply overloaded with too much work right now!LLinux reported or Linux-only issue, such as with tuntap networking that doesn't occur on Windows.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions