Skip to content

Redraw the map after the TERMINAL TOO SMALL screen - #13

Merged
Critlist merged 1 commit into
mainfrom
fix/resize-redraw
Oct 12, 2026
Merged

Critlist merged 1 commit into
mainfrom
fix/resize-redraw

Conversation

@Critlist

Copy link
Copy Markdown
Owner

Shrinking the terminal below 80x24 and then restoring the same 80x24 left the "TERMINAL TOO SMALL" text on screen and never redrew the map.

Cause: check_resize() only calls docrt() when the size differs from last_cols/last_rows. The too-small loop never updates those, so restoring the original size looks like no change.

Fix: a was_small flag set on entering the loop forces the redraw. 5 lines in src/root/hack.main.c, plus a CHANGELOG entry.

Found by: the soak harness being ported from restoHack. Its runner saw the stale screen and stopped getting output, which looked like a hang.

Verified with a pexpect script: shrink to 72x12, take a turn, restore 80x24.

Build Too-small screen After restore
main shown stale warning, no map
this PR shown map redrawn immediately

🤖 Generated with Claude Code

check_resize() only called docrt() when the size differed from
last_cols/last_rows, which the too-small loop never updates. Shrinking
the terminal and restoring the same 80x24 left the warning on screen
over a stale map. Found by the soak harness port.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Critlist
Critlist merged commit ffc8a3c into main Oct 12, 2026
5 checks passed
neuhaus pushed a commit to neuhaus/protoHack that referenced this pull request Nov 15, 2026
Redraw the map after the TERMINAL TOO SMALL screen
neuhaus pushed a commit to neuhaus/protoHack that referenced this pull request Nov 15, 2026
…; docs

- quit reads the screen (dismiss --More--, cancel prompts, then Q):
  blind ' ' passed turns and new --More-- pages swallowed the Q
- restore check looks only at the respawned game's output
- a TERMINAL TOO SMALL screen still up after restoring 80x24 fails
  the run (the bug fixed in Critlist#13)
- dev/README.md: lanes, what a run does, soak recipe, replay
- CHANGELOG entry

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant