Files
tty7/docs/terminal/history.mdx
T
l0ng-ai fed4aec170 docs: replace placeholder screenshots and add a one-minute tour video
Every placeholder frame in docs/ now shows a real capture of the current
build: 20 screenshots plus two short looping clips (prompt editor, pane
drag). The README and the docs home page link a one-minute tour covering
agent status across repos, one agent driving another through the CLI,
the prompt editor, diffs, pane dragging, and sessions surviving a quit.
2026-09-24 08:18:14 +08:00

66 lines
2.8 KiB
Plaintext

---
title: "History"
description: "Fuzzy history search, and whether each pane gets its own."
---
## Fuzzy search with <kbd>⌃ R</kbd>
<kbd>⌃ R</kbd> opens a fuzzy search over what you have actually run. Type any
fragment — the letters do not have to be adjacent — and the list narrows.
Each row carries context the plain shell version throws away:
- **when** you last ran it, as a relative time
- **whether it failed**, from the exit code
A command appears once, however many times you have run it — repeats collapse
into their most recent occurrence. Ranking mixes frequency with recency, and
commands you ran in the *current* directory are pushed up, so the thing you want
is usually the thing you last did here.
<Frame caption="⌃R: fuzzy matches with relative time, a failed run marked by its exit code">
<img src="/images/history-search.webp" alt="Fuzzy history search" />
</Frame>
<kbd>⏎</kbd> puts the command on the prompt. <kbd>⌘ ⏎</kbd> puts it there and
runs it. <kbd>Esc</kbd> closes without touching it.
### Handing <kbd>⌃ R</kbd> back
If you already have an fzf, percol, atuin or McFly binding you like, turn off
**Settings → Terminal → Prompt & command history → Command history search** (`history_search: false`).
<kbd>⌃ R</kbd> then goes to the shell, and whatever you bound there keeps
working.
That releases <kbd>⌃ R</kbd> and nothing else — <kbd>↑</kbd> still walks tty7's
own history list. To give the shell the whole prompt, including <kbd>↑</kbd> and
whatever widget you bound to it, turn off
[the prompt editor](/terminal/prompt#giving-the-whole-prompt-back-to-the-shell)
(`prompt_editor: false`).
## Where the history comes from
Your existing shell history file, as-is. Nothing is imported or converted, and a
history written outside tty7 shows up immediately.
The per-row extras — when you last ran it, whether it failed — come from a small
file tty7 keeps alongside it, filled in as you run things. A command tty7 has
never seen still appears; it just arrives without a timestamp or an exit code.
## One history, or one per pane
By default every pane shares your shell's history file, which is what a terminal
has always done: a command typed in one pane is available in the next.
**Settings → Terminal → Prompt & command history → Separate command history per pane**
(`per_pane_history: true`) changes that. Each pane gets a private history file:
- **seeded** from your real history when the pane opens, so it is not blank
- **merged back** into your real history when the pane closes, so nothing typed
is lost
Useful when several agents or several tasks are running side by side and you do
not want their commands interleaved in your <kbd>↑</kbd> key. Off by default,
because someone who has not asked for it would experience the change as their
history mysteriously forgetting the other window.