aws-sso-cli
aws-sso-cli copied to clipboard
`CTRL-C` in windows causes crash, loss of command history, garbled pasting.
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:
- Run powershell
- Enter exec mode
aws-sso exec -p 1234:role pwsh
. - Confirm that you are now authenticated to AWS :
aws sts get-caller-identity
- Start a long running command that you will CTRL-C from.
gci c:\ -recurse
. Let it run for several seconds andCTRL-C
- At this point your aws-sso process has died, but you can't see it.
- 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. -
aws sts get-caller-identity
and you won't be authenticated any more. - Copy some text from somewhere else and paste it in, it will become garbled.
- Running
dir c:\ -recurse
again and tryingctrl-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.
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.