Skip to main content
WezTerm provides a searchable scrollback buffer that allows you to review terminal output that has scrolled off the screen. The scrollback buffer has a configurable size limit and supports powerful search capabilities.

Scrollback Buffer

As content is printed to the terminal, lines that scroll off the top are moved into the scrollback buffer where they can be reviewed by scrolling up.

Configuring Scrollback Size

Control how many lines of history are retained:
Configure Scrollback Lines
Larger scrollback values require more memory. If you have many long-lived tabs, consider the impact on system RAM when setting this value.

Scrollbar Configuration

Enable or disable the visual scrollbar:
Enable Scrollbar
You can customize the scrollbar colors in your color scheme configuration.

Keyboard Navigation

Programmatic Scrolling

Custom Scroll Bindings

Searching the Scrollback

WezTerm includes a powerful search overlay that lets you find text in your scrollback buffer.

Activating Search Mode

Search Mode Controls

When the search overlay is active:

Search Modes

Press Ctrl+R to cycle through three search modes:
  1. Case-sensitive text matching - Exact case match
  2. Case-insensitive matching - Ignores case differences
  3. Regular expression - Uses Rust regex syntax
The current mode is indicated in the search bar.

Saved Searches

Create keybindings to search for common patterns instantly.
Search for Git Hashes
1

Press Ctrl+Shift+H

Activates the search and highlights all git hashes.
2

Navigate with Enter/Ctrl+N/Ctrl+P

Cycle through the highlighted hashes.
3

Copy with Ctrl+Shift+C

Copy the selected hash to the clipboard.
4

Paste with Ctrl+Shift+V

Paste the hash where needed.

More Saved Search Examples

Clearing the Scrollback

Remove all scrollback history from the current tab:
Clearing the scrollback buffer is permanent and cannot be undone.

Custom Clear Binding

Custom Clear Scrollback

Customizing Search Mode

You can customize the key bindings for search mode by overriding the search_mode key table:
Custom Search Bindings

Performance Considerations

  • Memory usage increases with scrollback_lines setting
  • Search performance depends on scrollback size and pattern complexity
  • Consider reducing scrollback size for resource-constrained systems
  • Regular expressions are more powerful but can be slower than simple text searches
Scrollback search integrates with Copy Mode for keyboard-driven text selection and copying workflows.