Open the find bar in a terminal to look through its scrollback for a word, an error message, or a filename. You can step through matches and switch the search to another terminal you have open.
Before you start
- Desktop app only. Open the terminal in the desktop app on your computer.
- Have a terminal open in a Code project, with some output already on screen that you want to search through.
Open the find bar
- Select the terminal you want to search so it takes focus.
- Press ⌘F (Ctrl+F on Windows). The find bar opens at the top of the window.
- Type the word you want to find. The bar waits a moment after your last keystroke, highlights matches in the scrollback, and scrolls to the match closest to what the terminal is showing.
The bar needs at least two characters before it searches. The count on the right of the field shows the current match position and the total, such as 3 of 12.
Step through matches
- Press Enter for the next match, or Shift+Enter for the previous one.
- Or select the up and down arrows in the bar. The terminal scrolls to the match it selected and the counter on the right updates.
The highlights refresh as the terminal prints new output, so a long-running command keeps adding matches to the count.
Switch which terminal you are searching
When more than one terminal is open, the bar shows a row of numbered icons at the left of the field, one per terminal. Each icon has the terminal's name in its tooltip, such as Terminal 2: dev server. Select another icon to search that terminal instead. The search text stays in the field when you switch terminals, including when you return to the first one.
Close the bar
Press Escape or select the close button in the bar. Highlights disappear. The bar closes. If you opened the bar without searching, anything you had selected in the terminal stays selected.
If no matches show up
- Check the count on the right of the field.
0 of 0means the word is not in the saved scrollback. Try a shorter phrase, or run the command again to produce fresh output. - Older output rolls out of the scrollback as a terminal prints more, so a match from earlier in the session may no longer be in the saved lines.
