Context
When running iecs exec from environments without a TTY (e.g., Claude Code, Cursor, CI pipelines, or scripted automation), the AWS SSM session drops prematurely for commands that take time to produce output.
This happens because the SSM Session Manager plugin expects a pseudo-terminal to keep the connection alive. Without one, sessions disconnect before longer-running commands finish.
Reproduction
Commands that produce immediate output work fine:
iecs exec --command "echo hello"
Commands that take a few seconds before producing output fail — the session drops before the output arrives:
# Simulating a slow command (e.g., a Rails runner that takes ~5s to boot)
iecs exec --command "sleep 5 && echo done"
Workaround
Wrapping the call in script to allocate a PTY:
script -q /dev/null iecs exec --command "sleep 5 && echo done"
Suggestion
iecs could detect when it's running without a TTY and either:
- Automatically allocate a PTY (e.g., via
os.Stdin file descriptor check)
- Warn the user that the session may be unstable without a TTY
- Provide a
--pty flag to explicitly request PTY allocation
This would improve the experience when using iecs from AI-powered editors like Claude Code and Cursor, as well as CI pipelines and other non-interactive use cases.
Context
When running
iecs execfrom environments without a TTY (e.g., Claude Code, Cursor, CI pipelines, or scripted automation), the AWS SSM session drops prematurely for commands that take time to produce output.This happens because the SSM Session Manager plugin expects a pseudo-terminal to keep the connection alive. Without one, sessions disconnect before longer-running commands finish.
Reproduction
Commands that produce immediate output work fine:
Commands that take a few seconds before producing output fail — the session drops before the output arrives:
Workaround
Wrapping the call in
scriptto allocate a PTY:Suggestion
iecs could detect when it's running without a TTY and either:
os.Stdinfile descriptor check)--ptyflag to explicitly request PTY allocationThis would improve the experience when using iecs from AI-powered editors like Claude Code and Cursor, as well as CI pipelines and other non-interactive use cases.