Unix: command line --windowtype:foo fix

initoptions(), including initoptions_finish(), was running to
completion with the default window system before windowtype from the
command was parsed and activated.  When the default window system
is tty without MS-DOS the map type gets set to ascii; command line
--windowtype:X11 doesn't switch it back to the X11 default of tiled.

So,
| NETHACKOPTIONS=windowtype:X11 nethack
ran nethack in tiles mode but
| nethack --windowtype:X11
ran it in text mode (assuming .nethackrc left tiles vs text with the
default setting).

I think this fix is quite iffy but it seems to work as intended....
It reclassifies '--windowtype' as an "early option" in unixmain.c,
and the options.c code ultimately processes it twice.
This commit is contained in:
PatR
2022-08-28 00:09:50 -07:00
parent 1bdfeb04ab
commit 11c8d5cd5e
6 changed files with 40 additions and 13 deletions

View File

@@ -1369,6 +1369,10 @@ end of game with DUMPLOG could panic due to perm_invent handling, even when
with color Off and the screen symbol for ice the same as for floor, the black
and white ice was supposed to be rendered in inverse video but that
got broken by the symbols and glyphs overhaul
command line processing interleaved with options file processing is complex:
a recent change to make 'color' show up for tty in the short options
menu resulted in 'nethack --windowtype:X11' running X11 with ascii map
('NETHACKOPTIONS=windowtype:X11 nethack' continued to default to tiles)
curses: 'msg_window' option wasn't functional for curses unless the binary
also included tty support