Skip to content

Fix interactive SSH sessions - #45

Open
joehoyle wants to merge 2 commits into
mainfrom
agent/fix-ssh-session-input
Open

Fix interactive SSH sessions#45
joehoyle wants to merge 2 commits into
mainfrom
agent/fix-ssh-session-input

Conversation

@joehoyle

@joehoyle joehoyle commented Jul 21, 2026

Copy link
Copy Markdown
Member

Summary

  • resume stdin and enable raw terminal input once an SSM session connects
  • ping the active SSM session directly instead of reading this.awsSSMSession
  • clean up terminal listeners, timers, and raw mode when a session disconnects
  • add focused regression tests for input forwarding, the ~. escape, and keepalive pings
  • run tests in GitHub Actions on Node.js 20, 22, and 24

Why

After the CLI's ESM conversion, the keepalive callback attempted to read this.awsSSMSession while this was undefined. This crashed connected SSH sessions when the 30-second timer fired.

Inquirer can also leave stdin paused after prompting, so attaching a data listener alone did not reliably make an established session interactive.

User impact

Users can type immediately after connecting, sessions no longer crash on the first keepalive interval, and terminal state is restored during cleanup.

Validation

  • node --test test/ssh.test.js — 3 tests passing locally
  • GitHub Actions — Node.js 20, 22, and 24 passing
  • workflow YAML parse check
  • git diff --check

@joehoyle
joehoyle requested a review from jerico July 21, 2026 22:28
@joehoyle
joehoyle marked this pull request as ready for review July 21, 2026 22:28
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

Successfully merging this pull request may close these issues.

1 participant