diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index f589597..96128a9 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixed +- After the "TERMINAL TOO SMALL" screen, the map wasn't redrawn if the terminal went back to the same size it had before the shrink (`check_resize()` only redrew on a size change), so the warning stayed on screen. It now always redraws after that screen. - Fixed a segfault on Ctrl-R (repeat last message) when there was no previous message: the 1982 `pline(0)` path fell through to `index(NULL,'%')`. Both the normal and SMALL builds now print "No message.". (#11) - A comma in the player name (set via `name=` in options) split the high-score record line and wiped the record file. Commas in names are now replaced with `_`, and the record reader bounds its fields to their buffers. (#11) - Fixed a crash at death from a wraith's level drain: the 1982 code never set `killer` there, so `done()` hit `strcpy(..., NULL)`. `done()` now also defaults `killer` for any other death path that misses it. (#12) diff --git a/src/root/hack.main.c b/src/root/hack.main.c index ccbe381..8acb002 100644 --- a/src/root/hack.main.c +++ b/src/root/hack.main.c @@ -29,6 +29,7 @@ static void check_resize(void) { struct winsize ws; int cols=0, rows=0; + int was_small=0; /* Modern: the TOO SMALL screen overwrote the map */ if(!resize_pending) return; resize_pending=0; @@ -41,6 +42,7 @@ static void check_resize(void) rows=24; } if(cols<80 || rows<24) { + was_small=1; for(;;) { fd_set rfds; struct timeval tv; @@ -67,7 +69,9 @@ static void check_resize(void) if(cols>=80 && rows>=24) break; } } - if(cols!=last_cols || rows!=last_rows) { + /* Modern: also redraw after the TOO SMALL screen even if the size is back + to what it was before the shrink, or that screen stays up */ + if(was_small || cols!=last_cols || rows!=last_rows) { docrt(); pline("[Terminal resized to %dx%d - display refreshed]",cols,rows); last_cols=cols;