Skip to content

fix: Normalize PTY \r\n to \n in captured output#19

Merged
haugoug merged 1 commit intogvsoc:mainfrom
germainh512:fix-pty-crlf
Mar 11, 2026
Merged

fix: Normalize PTY \r\n to \n in captured output#19
haugoug merged 1 commit intogvsoc:mainfrom
germainh512:fix-pty-crlf

Conversation

@germainh512
Copy link

PTYs produce \r\n line endings instead of \n. This causes Checker commands to fail when comparing output against expected strings with \n.

Strips \r from each line before storing in test output.

@germainh512 germainh512 force-pushed the fix-pty-crlf branch 7 times, most recently from d585dd6 to 81130be Compare March 11, 2026 13:29
PTY output capture had race conditions where EIO could fire
before buffered data was consumed, causing empty output in
Checker commands.

Switch to subprocess.PIPE + start_new_session=True:
- Pipes give reliable output capture (no EIO races)
- start_new_session isolates the process group (prevents
  terminal corruption from SDL2/ncurses, enables killpg)
- stderr merged into stdout via STDOUT
- stdin set to DEVNULL

136 tests passing.
@haugoug haugoug merged commit 8aa8e3d into gvsoc:main Mar 11, 2026
3 checks passed
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.

2 participants