Skip to content

Scrollback search

Find in terminal searches everything a terminal holds: the screen and the scrollback above it. Use it to find an error in a long build log, an address in a configuration dump or a time in a log stream.

On a computer (Windows, macOS, Linux):

  • Press Ctrl+Shift+F. It works while you are typing in a terminal. The key is the same on macOS (shown as ⌃⇧F), and you can change it under Settings > Keyboard and mouse (Find in terminal).
  • Or open the command palette and choose Find in terminal (listed while a session is open).
  • On macOS, the menu bar also has Edit > Find in terminal (⇧⌘F).

Find opens above the terminal that has the keyboard. If no terminal has it, Find opens for the session shown in front. With no terminal open, the app says “Open a terminal to search its output”. Press the key again to put the keyboard back in an open Find field.

On a phone or tablet:

  • Tap More actions (the three dots in the terminal’s toolbar), then Find.
  • Or touch and hold the terminal until the sheet opens, then tap Find.
  • With a hardware keyboard, press Ctrl+Shift+F on Android or Cmd+Shift+F on an iPhone or iPad.

Type into the field (Find in terminal…). Results update a moment after you stop typing. Every match is highlighted, and the current match is highlighted more strongly than the others.

The first match shown is the last one in the buffer, the most recent output. The terminal scrolls to bring each current match into view.

The counter shows where you are, for example 3/17. When nothing matches it shows No results.

  • Next match (down arrow) or Enter: the next match.
  • Previous match (up arrow) or Shift+Enter: the one before.

Both wrap around: after the last match you are back at the first.

  • Aa (Case sensitive): off by default, so “error” also finds “Error” and “ERROR”. Tap it to match case exactly.
  • \b (Whole word): finds the text only as a whole word, so “log” no longer matches inside “blog”.

Tap Close search (the X) or press Escape. The highlights go away and the keyboard goes back to the terminal.

In the tmux view, Find searches the tmux pane in front. Switch to another pane and the same text is searched there.

  • Find stops counting at 500 matches. The counter then shows a plus sign, for example 12/500+. Type more of what you are looking for to narrow it.
  • The search is for plain text. It does not take regular expressions.
  • Each row of the terminal is searched on its own, so text that wraps from one row onto the next is not found as one match.
  • Find searches what the terminal shows, not the color and cursor codes behind it.

To scroll the history from the keyboard, press Shift+Page Up or Shift+Page Down (while a full-screen program such as vim, less or tmux runs, those keys go to it instead).

How far back you can scroll, and so how far Find can look, is one setting for every session. There is no value per host.

  • Default: 50,000 lines.
  • On a computer: open Settings > Terminal and SSH, then Scrollback buffer under Behavior. Choose 1k, 2k, 5k, 10k, 20k or 50k lines. A value set on a phone that is none of these (any number of lines, or unlimited) is listed too, as “Unlimited scrollback” or as its number of lines.
  • On a phone or tablet: open More > Settings > Terminal and SSH, then tap Scrollback lines and type a whole number. 0 means unlimited, and the row then reads “Unlimited scrollback”. A blank, negative or non-numeric value is refused with “Enter a number greater than 0”.

What to know:

  • New sessions only. The size is set when a session’s terminal is created. A change applies to the sessions you open after it. Reconnect a session to give it the new size.
  • Unlimited has a ceiling of 1,000,000 lines. Every kept line uses memory: if the app slows down after very long logs, lower the value.
  • tmux panes in the tmux view keep at most 20,000 lines each, whatever the setting says.
  • Sync: the value is one of the settings your devices share when you sync. A synced value above 5,000,000 lines is lowered to 5,000,000.