Skip to content

fix(core): stop spinning on terminal read errors#97

Open
liamg wants to merge 1 commit intoreeflective:masterfrom
liamg:fix-revoked-tty-spin
Open

fix(core): stop spinning on terminal read errors#97
liamg wants to merge 1 commit intoreeflective:masterfrom
liamg:fix-revoked-tty-spin

Conversation

@liamg
Copy link
Copy Markdown
Contributor

@liamg liamg commented Mar 17, 2026

Summary

  • surface non-EOF terminal read failures from the key reader instead of treating them as empty input
  • return terminal read errors from Readline() so callers can exit cleanly when the tty disappears
  • add regression coverage for EOF and non-EOF key read failures

Problem

When stdin starts returning a non-EOF read error, the Unix key-reading path currently ignores it and returns an empty key buffer. WaitAvailableKeys() then loops forever, allocating a fresh buffer each time and burning CPU in the input loop.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 17, 2026

Codecov Report

❌ Patch coverage is 75.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 32.84%. Comparing base (0637db4) to head (0c6af78).
⚠️ Report is 16 commits behind head on master.

Files with missing lines Patch % Lines
emacs.go 0.00% 2 Missing ⚠️
readline.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master      #97      +/-   ##
==========================================
- Coverage   33.03%   32.84%   -0.19%     
==========================================
  Files          57       58       +1     
  Lines        9109     9224     +115     
==========================================
+ Hits         3009     3030      +21     
- Misses       6062     6154      +92     
- Partials       38       40       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@liamg liamg marked this pull request as ready for review March 17, 2026 09:14
@maxlandon
Copy link
Copy Markdown
Member

Awesome !!!!!

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