Skip to content

fix(accessibility): stop scanning on EOF from stdin#440

Merged
caarlos0 merged 1 commit intocharmbracelet:mainfrom
aybabtme:stop-scanning-on-eof
Nov 27, 2024
Merged

fix(accessibility): stop scanning on EOF from stdin#440
caarlos0 merged 1 commit intocharmbracelet:mainfrom
aybabtme:stop-scanning-on-eof

Conversation

@aybabtme
Copy link
Copy Markdown
Contributor

@aybabtme aybabtme commented Oct 25, 2024

If a user send EOF to stdin (Ctrl-C) in the terminal while in accessibility mode, the program gets stuck in a loop printing errors about invalid input:

Example:
CleanShot 2024-10-25 at 19 19 41
"oh nooo....." screams the terminal, as it descends into a demented spiral

This change isn't ideal (it'd be better to somehow bubble up an error that stops execution) but it's better than getting the process stuck in a loop. An alternative that doesn't change the signature would be to panic, or os.Exit or something else. Happy with whatever.

@aybabtme aybabtme force-pushed the stop-scanning-on-eof branch from f869ade to 947aa08 Compare October 25, 2024 10:27
@aybabtme aybabtme changed the title accessibility: stop scanning on EOF from stdin fix(accessibility): stop scanning on EOF from stdin Oct 25, 2024
@caarlos0 caarlos0 merged commit dba9876 into charmbracelet:main Nov 27, 2024
@caarlos0
Copy link
Copy Markdown
Member

thanks!

@aybabtme aybabtme deleted the stop-scanning-on-eof branch November 29, 2024 06:42
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