Skip to content

Conversation

@kearns-cu
Copy link

@kearns-cu kearns-cu commented Jan 15, 2026

Fixes #1180

Summary

Adds support for interactive bash commands (like opencode auth login, vim, ssh) by using the existing PTY infrastructure when interactive: true is set.

Changes

  • Added interactive parameter to bash tool with allowlist of supported commands
  • Created BashInteractive TUI component that connects to PTY via WebSocket
  • Falls back to regular spawn if PTY fails or command not in allowlist
  • ESC key exits interactive mode

How it works

When interactive: true and command is in allowlist → creates PTY session → TUI component captures keyboard input and streams it to/from PTY. Everything else works exactly as before.

Testing needed

  • Try opencode auth login with arrow keys
  • Verify vim test.txt works
  • Check ls -la still works (falls back to regular mode)

Allowlisted commands

vim, vi, nano, emacs, ssh, telnet, opencode, less, more, htop, top, man, psql, mysql, sqlite3, python, python3, node, irb

Adds support for interactive bash commands requiring user input (arrow keys,
text entry, etc.) by leveraging the existing PTY infrastructure.

- Add interactive parameter to bash tool with allowlist of supported commands
- Create BashInteractive TUI component with WebSocket PTY connection
- Implement retry logic with exponential backoff for connection failures
- Add ESC key to exit interactive mode
- Silent fallback to regular spawn for unsupported commands or PTY failures

Fixes anomalyco#1180
@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found one potentially related PR:

Process Tools for Interactive CLI commands
#2483

This PR may be related as it also addresses interactive CLI command support, which appears to be in the same problem domain as PR #8696's interactive bash command feature.

All other results were either the current PR (#8696) itself or unrelated PRs.

@kearns-cu kearns-cu closed this Jan 15, 2026
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.

Support for running commands that use raw mode stdin

1 participant