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:
- Allocates a PTY pair (openpty)
- Forks a child process in the PTY
- Returns a
session_id for bidirectional I/O
- Supports
exec to send input lines and read_async_result to stream output
- 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.
Problem
The current
terminaltool 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 asaiCLI chat tools,vim,htop,nano, or any program usingreadline/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=ptythat:session_idfor bidirectional I/Oexecto send input lines andread_async_resultto stream outputThis would enable:
aiCLI)vim,nano)htop,btm)Implementation Hints
ptymodule oros.openpty()select/poll to multiplex PTY master fd reads with socket eventsopenpty()nativelyUse Case from Device
Running on Android device with
/data/bin/ai(interactive DeepSeek chat CLI). Works fine viaadb shellor 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.