Skip to content

Add shell command input mode + execution to TUI#13406

Merged
harryalbert merged 12 commits into
masterfrom
harry/code-1805-shell-command-execution
Jul 8, 2026
Merged

Add shell command input mode + execution to TUI#13406
harryalbert merged 12 commits into
masterfrom
harry/code-1805-shell-command-execution

Conversation

@harryalbert

@harryalbert harryalbert commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

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

  • I have manually tested my changes locally with ./script/run

Screenshots / Videos

https://www.loom.com/share/97a50459c6764668a3c9aced781621e8

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

harryalbert commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

@cla-bot cla-bot Bot added the cla-signed label Jul 6, 2026
@harryalbert harryalbert force-pushed the harry/code-1805-shell-command-execution branch from 1c000ac to 365b001 Compare July 6, 2026 15:09
@harryalbert harryalbert force-pushed the harry/input-mode-policy branch from 4898f7e to 9a167a5 Compare July 6, 2026 15:09
Base automatically changed from harry/input-mode-policy to master July 6, 2026 16:05
@harryalbert harryalbert force-pushed the harry/code-1805-shell-command-execution branch from 0b13b06 to 2b8d6f6 Compare July 6, 2026 16:05
@harryalbert harryalbert changed the title add tech and product specs Add shell command input mode + execution to TUI Jul 6, 2026
@harryalbert harryalbert changed the base branch from master to graphite-base/13406 July 6, 2026 22:06
@harryalbert harryalbert force-pushed the harry/code-1805-shell-command-execution branch from 725672f to 4a96178 Compare July 6, 2026 22:06
@harryalbert harryalbert changed the base branch from graphite-base/13406 to harry/tui-flex-alignment July 6, 2026 22:06
@harryalbert harryalbert force-pushed the harry/code-1805-shell-command-execution branch from 4a96178 to 108ff28 Compare July 6, 2026 22:09
@harryalbert harryalbert marked this pull request as ready for review July 6, 2026 22:29
@harryalbert harryalbert requested a review from kevinyang372 July 6, 2026 22:29
@oz-for-oss

oz-for-oss Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

@harryalbert

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 /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 queues SelectionStartAt without a matching SelectionEnd, 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

Comment thread crates/warp_tui/src/input/view.rs Outdated
Comment thread crates/warp_tui/src/terminal_session_view.rs Outdated
@harryalbert harryalbert force-pushed the harry/code-1805-shell-command-execution branch from bcc8077 to 37bafb8 Compare July 7, 2026 18:47
@harryalbert harryalbert force-pushed the harry/tui-flex-alignment branch from 23000b8 to a16368f Compare July 7, 2026 18:47
@harryalbert harryalbert mentioned this pull request Jul 7, 2026
2 tasks
Base automatically changed from harry/tui-flex-alignment to master July 7, 2026 20:17
@harryalbert harryalbert force-pushed the harry/code-1805-shell-command-execution branch from 37bafb8 to cab95a5 Compare July 7, 2026 20:17
Comment thread app/src/terminal/terminal_manager.rs
Comment thread crates/warp_tui/src/input/view.rs Outdated
Comment thread crates/warp_tui/src/input/view.rs Outdated
Comment thread crates/warp_tui/src/input/view.rs Outdated
Comment thread crates/warp_tui/src/input/view.rs Outdated
Comment thread crates/warp_tui/src/input/view.rs Outdated
Comment thread crates/warp_tui/src/agent_block.rs Outdated
Comment thread crates/warp_tui/src/terminal_session_view.rs Outdated
Comment thread crates/warp_tui/src/terminal_session_view.rs
harryalbert and others added 2 commits July 8, 2026 13:49
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>
harryalbert and others added 8 commits July 8, 2026 13:54
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>
@harryalbert harryalbert force-pushed the harry/code-1805-shell-command-execution branch from 9656467 to 2ad9ea3 Compare July 8, 2026 18:09
@harryalbert harryalbert force-pushed the harry/code-1805-shell-command-execution branch from 2ad9ea3 to 4f8db0a Compare July 8, 2026 18:24
@harryalbert harryalbert merged commit 34c909f into master Jul 8, 2026
26 checks passed
@harryalbert harryalbert deleted the harry/code-1805-shell-command-execution branch July 8, 2026 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants