Handle input errors while returning to correct terminal mode #186
No reviewers
Labels
No Label
blocked
bug
build
documentation
duplicate
enhancement
finger
gemini
gopher
help wanted
http
in progress
invalid
local
needs-info
non-code
non-functional
non-urgent
question
release
rendering
suggestion
telnet
terminal
urgent
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sloum/bombadillo#186
Loading…
Reference in New Issue
No description provided.
Delete Branch "handle_input_errors"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #184
This approach uses
defer
to ensure character mode is reenabled no matter how the function returns. An alternative approach would see a secondtermios.SetCharMode()
statement within the error check block.There doesn't seem to be any other occurrences of this specific issue, so I think it only needs to be addressed here.
This looks good to me. I think I was thinking about it wrong in my head and this makes perfect sense. 👍