Thanks to visit codestin.com
Credit goes to github.com

Skip to content

use run_interactive for localstack ssh to fix tty issues #9211

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

Merged
merged 2 commits into from
Sep 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions localstack/cli/localstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,17 +617,12 @@ def cmd_ssh() -> None:
`MAIN_CONTAINER_NAME`.
"""
from localstack.utils.docker_utils import DOCKER_CLIENT
from localstack.utils.run import run

if not DOCKER_CLIENT.is_container_running(config.MAIN_CONTAINER_NAME):
raise CLIError(
f'Expected a running LocalStack container named "{config.MAIN_CONTAINER_NAME}", but found none'
)
try:
process = run("docker exec -it %s bash" % config.MAIN_CONTAINER_NAME, tty=True)
process.wait()
except KeyboardInterrupt:
pass
os.execlp("docker", "docker", "exec", "-it", config.MAIN_CONTAINER_NAME, "bash")


@localstack.group(name="update", short_help="Update LocalStack")
Expand Down