What do you want to change?
The TUI entrypoints enter full alt-screen TUI mode even when there is no TTY at all: (Observed on hunk 0.17.0)
$ hunk diff </dev/null 2>&1 | cat
Happy to help contribute a fix to this
Why?
Right now if an agent invokes the command if the user references it, or if you happen to try to pipe the output, the output is not super helpful.
How? (optional)
When a TUI-launching command (diff, show, stash show, patch, pager, difftool) is invoked and either
- there's no usable TTY, or
- a known coding-agent env var is set (CLAUDECODE, AI_AGENT, CURSOR_AGENT, CODEX_SANDBOX, OPENCODE, …) needed because some agents run commands in a real PTY (Cursor's terminal, tmux-style agent panes)
don't enter the TUI. Print a brief, skill-like response instead, enough for an agent to self-serve or someone else to know what went wrong. This should likely go to stderr.
Alternatively a simple error would make sense here as well
What do you want to change?
The TUI entrypoints enter full alt-screen TUI mode even when there is no TTY at all: (Observed on hunk 0.17.0)
$ hunk diff </dev/null 2>&1 | catHappy to help contribute a fix to this
Why?
Right now if an agent invokes the command if the user references it, or if you happen to try to pipe the output, the output is not super helpful.
How? (optional)
When a TUI-launching command (diff, show, stash show, patch, pager, difftool) is invoked and either
don't enter the TUI. Print a brief, skill-like response instead, enough for an agent to self-serve or someone else to know what went wrong. This should likely go to stderr.
Alternatively a simple error would make sense here as well