Skip to content
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

Terminal settings not restored after aws ecs execute-command #34

Open
groner opened this issue Feb 25, 2022 · 5 comments
Open

Terminal settings not restored after aws ecs execute-command #34

groner opened this issue Feb 25, 2022 · 5 comments

Comments

@groner
Copy link

groner commented Feb 25, 2022

Hi, I hope I've found the right place for this bug.

After running aws ecs execute-command --interactive, I loose handling of special characters for erase, werase, kill, eof, etc by the terminal. Running stty icanon is sufficient to get things working again.

I am using version 1.2.295.0 on linux.

I found it necessary to run a shell to reproduce this. Executing /bin/true did not reproduce the issue.

:; aws ecs execute-command --interactive ... --command /bin/bash

The Session Manager plugin was installed successfully. Use the AWS CLI to start a session.


Starting session with SessionId: ecs-execute-command-0ffda0a0ffda0a0ff
root@ip-1-2-3-4# exit


Exiting session with sessionId: ecs-execute-command-0ffda0a0ffda0a0ff.

:; cat # observe erase and eof not being processed, interrupt still works
^?^?^?^D^C
:; stty icanon
:; cat # observe handlng of special characters is restored
:;

The issue in this case was the icanon flag not being reset to it's previous state, but it's a good idea to capture the existing termios settings and restore them before exiting.

@Yangtao-Hua
Copy link
Contributor

Thank you for reporting this issue! To reproduce it, there is 2 questions: 1, Is there other settings in your container, or would you mind share your dockfile; 2, Is there problem found on other version of linux for you.

@groner
Copy link
Author

groner commented Mar 1, 2022

I'm using an image based on ubuntu:focal. I'm also able to reproduce the issue with an image based on postgres:11, which is based on debian:stretch-slim. In both cases the container is running on fargate.

If this isn't enough to reproduce the issue, please let me know and I can try to produce a testcase.

@groner
Copy link
Author

groner commented Mar 1, 2022

On the client side, I've only tested this on my dev host which runs ubuntu 20.04 which I access via ssh.

@justinmk3
Copy link

Related: #29 (comment)

@bdwyertech
Copy link

FWIW, in my application which wraps session-manager-plugin, I integrated a call out to reset after session-manager-plugin exits. I'm not sure why this happens, but just running reset usually fixes it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants