Skip to content

Feature Request: PTY session support for terminal tool (interactive TUI apps) #35

Description

@Chen9183

Problem

The current terminal tool only supports non-interactive command execution (open_and_exec, exec). It cannot run interactive TUI (Text User Interface) programs that require a real PTY (pseudo-terminal) — such as ai CLI chat tools, vim, htop, nano, or any program using readline/cursor control/ANSI escape codes.

Current Workaround

Pipe stdin into the program (e.g. echo "question" | ai), but this only works for one-shot input. No way to do multi-turn interactive dialogue.

Proposed Feature

A new terminal action like action=pty that:

  1. Allocates a PTY pair (openpty)
  2. Forks a child process in the PTY
  3. Returns a session_id for bidirectional I/O
  4. Supports exec to send input lines and read_async_result to stream output
  5. Properly handles terminal resize signals (SIGWINCH)

This would enable:

  • Interactive AI chat (ai CLI)
  • Text editors (vim, nano)
  • System monitors (htop, btm)
  • Any TUI program

Implementation Hints

  • Python pty module or os.openpty()
  • Use select/poll to multiplex PTY master fd reads with socket events
  • Android's bionic libc supports openpty() natively

Use Case from Device

Running on Android device with /data/bin/ai (interactive DeepSeek chat CLI). Works fine via adb shell or local terminal app, but cannot be driven by the Eta agent due to lack of PTY support.


Submitted via Eta Agent running on Android. This is a real feature gap encountered during daily use.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions