Skip to content

CTRL-C in windows causes crash, loss of command history, garbled pasting. #409

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
AHoran opened this issue Jul 21, 2022 · 1 comment
Closed
Labels
bug Something isn't working duplicate This issue or pull request already exists windows

Comments

@AHoran
Copy link

AHoran commented Jul 21, 2022

AWS SSO CLI Version 1.9.2 -- Copyright 2021-2022 Aaron Turner
307f13eb377284001a3545ea1394c2303786925f (v1.9.2) built at 2022-05-13T17:07:59-0700

Describe the bug:
In Windows when running a shell via aws-sso exec pwsh any usage of CTRL-C will cause major issues.
aws-sso seems to remain running when you use exec, and the first usage of ctrl-c causes it to crash.
Thereafter pasting text into the shell leads to garbled text, your command history has gone, and in some cases when selecting commands from history a different command is executed.

To Reproduce:

  1. Run powershell
  2. Enter exec mode aws-sso exec -p 1234:role pwsh.
  3. Confirm that you are now authenticated to AWS : aws sts get-caller-identity
  4. Start a long running command that you will CTRL-C from. gci c:\ -recurse . Let it run for several seconds and CTRL-C
  5. At this point your aws-sso process has died, but you can't see it.
  6. Now press up arrow key for your command history, note that it's probably aws-sso exec -p 1234:role pwsh. and not either of the other commands.
  7. aws sts get-caller-identity and you won't be authenticated any more.
  8. Copy some text from somewhere else and paste it in, it will become garbled.
  9. Running dir c:\ -recurse again and trying ctrl-c will no longer work as expected

Expected behavior:

  • Why does aws-sso need to still be running? Why does it need to intercept what's going to the shell?
  • ctrl-c shouldn't cause such serious follow on problems.
@AHoran AHoran added the bug Something isn't working label Jul 21, 2022
@synfinatic
Copy link
Owner

this seems related to or a duplicate of #91. To answer your question of why aws-sso needs to still be running is because it is starting a child process (in your case pwsh) when using exec. That is "as designed" and intentional with exec. it's possible with your comment in #188 we can avoid this on windows via eval, but need to find a few free moments to give it a try.

@synfinatic synfinatic added the duplicate This issue or pull request already exists label Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists windows
Projects
None yet
Development

No branches or pull requests

2 participants