Skip to content

[BUG] Ctrl+C handling breaks SSM session behavior #149

Description

@ditahkk

Describe the bug
Pressing Ctrl+C during an active SSM session kills the local ztictl process instead of interrupting the remote command, which drops the session unexpectedly.

To Reproduce

  1. Run ztictl ssm connect <instance-id> --region <region>.
  2. Execute a long-running command on the remote instance (for example sleep 60).
  3. Press Ctrl+C.
  4. The SSM session disconnects instead of just stopping the remote command.

Expected behavior
Pressing Ctrl+C should interrupt the remote command while keeping the SSM session alive.

Environment (please complete the following information):

  • OS: Ubuntu 22.04
  • Shell: bash
  • AWS CLI Version: 2.x
  • SSM Plugin Version: bundled with AWS CLI v2

Output of tool check command

ssm check
✔ AWS CLI installed
✔ Session Manager plugin installed
✔ AWS credentials valid
✔ SSM endpoints reachable

Additional context
This was caused by missing signal handling in the parent Go process, and was fixed by capturing SIGINT/SIGTERM and allowing them to pass through to the AWS CLI subprocess.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Fields

No fields configured for Story.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions