Skip to content

Can't CTRL-C after using go-prompt to select role #91

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

Closed
synfinatic opened this issue Nov 1, 2021 · 5 comments
Closed

Can't CTRL-C after using go-prompt to select role #91

synfinatic opened this issue Nov 1, 2021 · 5 comments
Labels
blocked Blocked on something else bug Something isn't working

Comments

@synfinatic
Copy link
Owner

synfinatic commented Nov 1, 2021

Basically go-prompt is blocking CTRL-C even after you have made a selection and Prompt.Run() has returned. The result is that if you try CTRL-C during AWS SSO / OIDC login/authentication, rather than the tool exiting like the user expects, they just see ^C printed in the terminal. The only way out is to either:

  1. Wait for the process to complete normally
  2. CTRL-Z to suspend + kill -9
@synfinatic synfinatic added the bug Something isn't working label Nov 1, 2021
@synfinatic synfinatic added this to the 1.2.1 milestone Nov 1, 2021
@synfinatic
Copy link
Owner Author

synfinatic commented Nov 2, 2021

problem only happens in exec/console (not something like list) because it is caused by go-prompt

Not fixes:

  1. this patch is not a fix: Fix wrong termios save code c-bata/go-prompt#239
  2. doing the doAuth() outside of Prompt.Run() doesn't help.
  3. [Bug] After exiting the program, ctrl+c is invalid c-bata/go-prompt#233 (comment)

synfinatic added a commit that referenced this issue Nov 2, 2021
Trying a few trick to see if I can get CTRL-C to work
after using go-prompt and before the program exits.  Whatever
go-prompt is doing to the terminal doesn't seem to be resetting
correctly?

Refs: #91
@synfinatic synfinatic added the blocked Blocked on something else label Nov 2, 2021
@synfinatic synfinatic removed this from the 1.2.1 milestone Nov 2, 2021
@synfinatic
Copy link
Owner Author

Marking as blocked at this time since this seems to be a go-prompt bug and I haven't found a work around. Also doesn't seem like go-prompt is being actively maintained :(

@synfinatic synfinatic changed the title aborting OIDC GetDeviceAuthInfo() is hard Can't CTRL-C after using go-prompt to select role Nov 2, 2021
@synfinatic
Copy link
Owner Author

synfinatic commented May 4, 2023

looks like everyone is forking go-prompt and applying this patch: c-bata/go-prompt#239

Note that this patch doesn't fix the CTRL-C bug.

@synfinatic synfinatic added this to the next release milestone May 4, 2023
@synfinatic synfinatic removed this from the next release milestone Jul 29, 2023
@synfinatic
Copy link
Owner Author

This seems fixed for me on macOS Ventura 13.4.1, iTerm 3.4.20 and aws-sso v1.12.0

@synfinatic
Copy link
Owner Author

Not really fixed, but documented the CTRL-d / exit for users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Blocked on something else bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant