aws / aws/session-manager-plugin

ssm start-session messes up the terminal after timeout on WSL

Open
#62 5 comments 2 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
320
Forks
97
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug

_Note: this issue was originally opened here: https://github.com/aws/aws-cli/issues/7574, but I was advised to re-open it here._

On WSL the `aws ssm start-session` command corrupts my terminal after it terminates due to inactivity. Regardless of what key I press, no characters appear in the terminal any more. I have tried Ctrl + C too, but it doesn't change the unresponsiveness of my terminal either.

### Expected Behavior

I should be able to use the terminal for other commands.

### Current Behavior

Regardless of what key I press, nothing appears in the terminal. The consequence of this is that I have to close the terminal and open a new one after more-or-less every connection, which is uncomfortable, considering that my history is gone, I have to go back to the same directory and have to initialize my AWS context again.

### Reproduction Steps

1. Install Ubuntu 2020 using WSL 2 on a Windows Enterprise machine.
2. Install AWS CLI and the SSM plugin
3. Launch a session with `aws ssm start-session --target i-XXXXXXXXXXX`
4. Wait 5 minutes
5. Now the terminal becomes unresponsive

### Possible Solution

_No response_

### Additional Information/Context

I start the ssm session like this:
```
aws ssm start-session --target i-0ac4445bb00XXXXXX
Starting session with SessionId: XXXX@YYYY.com
sh-4.2$ id
uid=1001(ssm-user) gid=1007(ssm-user) groups=1007(ssm-user) context=system_u:system_r:unconfined_service_t:s0
```

Then I wait a couple of minutes and press a random key:
```
sh-4.2$ Cannot perform start session: write tcp 172.22.193.94:55404->193.106.225.65:8080: write: broken pipe
```

The session is terminated due to some timeout. The problem occurs _after this_, as my terminal becomes unusable for further commands, nothing appears on my screen any more as I type.

### CLI version used

aws-cli/2.9.12 Python/3.9.11 Linux/5.10.16.3-microsoft-standard-WSL2 exe/x86_64.ubuntu.22 prompt/off

### Environment details (OS name and version, etc.)

Windows 10 Enterprise, WSL 2, Ubuntu 2020

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.