Skip to content

feat(tui): highlight Bash commands - #42214

Closed
kitlangton wants to merge 3 commits into
v2from
bash-highlighting
Closed

kitlangton wants to merge 3 commits into
v2from
bash-highlighting

Conversation

@kitlangton

@kitlangton kitlangton commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

What

Highlight Bash syntax wherever commands are shown or edited in the TUI:

  • ! Shell-mode prompt input while the user types
  • agent shell tool commands in inline and expanded tool views

Keywords, strings, variables, comments, and punctuation use the active TUI syntax theme.

How

  • packages/tui/src/component/prompt/index.tsx parses Shell-mode input as Bash after edits and applies the resulting theme styles directly to the textarea edit buffer. Stale asynchronous parser results are discarded, and highlights are removed when the input changes or Shell mode closes.
  • packages/tui/src/routes/session/index.tsx renders submitted Shell-mode commands and agent shell commands with the native <code filetype="bash"> component.
  • Shell output remains plain, subdued text beneath the highlighted command.

Scope

This changes TUI presentation only. It does not change command execution, shell selection, or tool behavior.

Testing

  • Direct Tree-sitter parser probe confirmed Bash captures for keywords, strings, variables, and comments.
  • bun typecheck from packages/tui
  • bun run test from packages/tui (689 passed, 5 skipped)
  • Prettier check and git diff --check
  • Full repository push-hook typecheck (34 packages passed)
  • Scripted OpenCode Drive capture exercised ordinary and compound Shell-mode input plus an actual agent shell tool call

Demo

Shell-mode editing

The recording shows ls -la, git status --short && echo "clean", and a loop with a variable and comment.

recording-0dfe3dcd-7316-4ef3-a873-f7d82da53199.mp4

Ordinary Shell-mode command

Compound Shell-mode command

Shell-mode loop with variable and comment

Agent shell tool call

The recording shows an actual agent shell tool call with highlighted command syntax and real shell output.

recording-ce3e4e40-098f-4735-a3a6-ccd774ec1374.mp4

Highlighted agent shell tool command

@kitlangton kitlangton changed the title feat(tui): highlight bash shell input feat(tui): highlight shell tool commands Aug 13, 2026
@kitlangton kitlangton changed the title feat(tui): highlight shell tool commands feat(tui): highlight Bash commands Aug 13, 2026
@kitlangton
kitlangton changed the base branch from dev to v2 August 13, 2026 02:47
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.

1 participant