Add shell command input mode + execution to TUI#13406
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
1c000ac to
365b001
Compare
4898f7e to
9a167a5
Compare
0b13b06 to
2b8d6f6
Compare
725672f to
4a96178
Compare
4a96178 to
108ff28
Compare
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR adds TUI ! shell input mode, routes shell-mode submissions to PTY command execution, updates TUI transcript/block spacing, and adds supporting tests/spec documentation.
Concerns
- Clicking the shell-mode
!gutter queuesSelectionStartAtwithout a matchingSelectionEnd, leaving the input view's drag-selection state armed after a simple click. - Shell-mode submissions pass
text.trim()into execution, so non-empty commands are not sent to the PTY exactly as typed.
Verdict
Found: 0 critical, 2 important, 0 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
bcc8077 to
37bafb8
Compare
23000b8 to
a16368f
Compare
37bafb8 to
cab95a5
Compare
Typing ! at the start of the TUI input enters shell mode, mirroring the
GUI: a blue ! affordance (not a buffer character), blue input border,
and a 'shell mode · esc to exit' hint line below the input. Enter
executes the text in the session PTY as a plain user command (rendered
as a terminal block in the transcript), cancels any in-progress
conversation, and is rejected with a transient hint while the agent
holds the PTY with a long-running command. Esc or backspace-at-start
exits shell mode, preserving typed text.
Built on the InputModePolicy refactor: shell mode is InputConfig
{Shell, locked} with the ShellPrefix source on the shared
BlocklistAIInputModel.
See specs/CODE-1805/PRODUCT.md and TECH.md.
Co-Authored-By: Oz <oz-agent@warp.dev>
The ! affordance is a fixed row child (glyph + right padding + a click-to-start hoverable) and the editor a flex child, so the gutter width and all inset arithmetic drop out of TuiInputElement. Relies on the stacked content-sized TuiFlex cross axis; also drops the footer's now-redundant one-row ConstrainedBox cap. Co-Authored-By: Oz <oz-agent@warp.dev>
Co-Authored-By: Oz <oz-agent@warp.dev>
9656467 to
2ad9ea3
Compare
2ad9ea3 to
4f8db0a
Compare

Description
Just like in the GUI, you should be able to manually enter bash input mode (using
!w/ the same semantics to enter and exit the shell mode) and, when in that mode, execute a shell command. We already have shell command execution and rendering mostly implemented in the TUI for free (given our re-use of the blocklist and terminal model) but we need to add in the bash input mode (rendering, entry, etc) and shell execution entry point.The most important files to look at are:
crates/warp_tui/src/terminal_session_view.rs— core new behavior: shell submit routing, PTY-busy rejection, conversation cancellation, footer hint priority.crates/warp_tui/src/input/view.rs— shell-mode entry/exit (!/backspace/esc)Testing
./script/runScreenshots / Videos
https://www.loom.com/share/97a50459c6764668a3c9aced781621e8
Agent Mode