# Shell integration & output

Use prompt marks, command results, and history navigation without a separate install step.

Canonical page: https://thebestterminal.com/docs/shell-integration

Harness 2.3.2 · Documentation reviewed 2026-10-13

## Automatic for supported shells

Harness injects shell integration when spawning bash, zsh, or fish. It uses OSC 133 prompt and command markers to connect terminal output to shell activity. No separate install step is needed for the normal supported-shell launch path.

Shell integration is not the same as an agent hook. It describes shell prompts and command boundaries; agent hooks report events from a specific tool.

## Move through commands instead of lines

| Action | Shortcut |
| --- | --- |
| Previous prompt | ⌘↑ |
| Next prompt | ⌘↓ |
| Select last finished command output | ⇧⌘A |

Prompt marks also support the command success/failure gutter. Find (⌘F) searches across scrollback and offers regular-expression and case-sensitivity controls.

## Use command boundaries in scripts

run --wait normally waits for its child command. With --keep-open, it can use the shell-integration completion mark while leaving the pane open. pane.wait supports waiting for a child or for a command boundary; inspect its schema before relying on a timeout or completion mode.

**Terminal**

```shell
harness-cli api describe pane.wait
```

## Disable when troubleshooting

**Terminal**

```shell
harness-cli set-option shell-integration off
```

Because integration is injected at spawn, test changes with a newly created shell. Disabling integration removes the prompt/command information needed by related navigation and waiting features. Manual shell snippets are available in the release-pinned source reference for environments that need a custom launch path.

> **Remote shells have their own startup path**
>
> A shell reached through SSH does not automatically inherit your local startup files. Diagnose the shell and host that actually emitted the output rather than assuming local integration configured every remote shell.

## Paths without accidental execution

Insert Path (⌥⌘I) inserts shell-quoted filenames into the originating pane without a trailing Return. Go to Directory (⌥⌘G) is the separate action that explicitly sends cd. Both stay attached to their source host and pane.

Find (⌘F) searches one pane and supports regular expressions. Search All Sessions searches literal text across retained output in open sessions; closed output is not a searchable archive.

## Source references

- [README.md](https://github.com/robzilla1738/harness-terminal/blob/2f843e5625086fbd33e58a724c632e47bfe66d1d/README.md)

- [docs/COMMANDS.md](https://github.com/robzilla1738/harness-terminal/blob/2f843e5625086fbd33e58a724c632e47bfe66d1d/docs/COMMANDS.md)

- [docs/shell-integration/README.md](https://github.com/robzilla1738/harness-terminal/blob/2f843e5625086fbd33e58a724c632e47bfe66d1d/docs/shell-integration/README.md)

- [docs/WORKSPACE-WORKFLOWS.md](https://github.com/robzilla1738/harness-terminal/blob/2f843e5625086fbd33e58a724c632e47bfe66d1d/docs/WORKSPACE-WORKFLOWS.md)

## Related guides

- https://thebestterminal.com/docs/keyboard-shortcuts

- https://thebestterminal.com/docs/automation-and-api

- https://thebestterminal.com/docs/troubleshooting

