-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restore terminal state on interrupt or exit #13382
Conversation
Thanks @nklaassen for the initial report. Planning on backporting to branch/v10. |
} | ||
|
||
// iAmHoldingTheLock exists only to draw attention to the need to hold the lock. | ||
type iAmHoldingTheLock struct{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't seen this one before. In most places we just suffix the method name with Locked
to indicate that you should hold the lock before calling.
Not that there's anything wrong with this. It's just different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can do the Locked suffix too, no strong preferences as long as something calls attention to it.
a9e2e3b
to
4466534
Compare
Addressed comments, PTAL? |
Thanks everyone, I'll merge while it's green. |
`prompt.ContextReader`, along with various parts of `lib/utils/prompt`, where re-written in master so we can alleviate input swallowing issues. For various reasons I didn't backport all changes to v9, but the less-eager input-swallowing loop is now what stands between us and issue #13021. This isn't a backport of a specific PR, but instead a port of the entire `lib/utils/prompt` package, as the PRs that touch the package unfortunately do more than we want to backport. The interfaces are still compatible and I did test various `tsh login` and `tsh ssh` scenarios. I've thrown in #13382 for good measure, as well. Closes #13021. * Backport lib/utils/prompt improvements * Fix lib/client tests * Restore terminal state on exit (#13382)
Fixes an issue with ContextReader on
bash
where abandoned password reads cause the terminal to remain "locked" even aftertsh
exits. This happens on interrupts but also on regular exit if the user picks a security key in the dual security key/OTP login prompt.Doesn't seem to affect shells like
zsh
orfish
.Repro steps: