Create highlight decorations in a single pass, dispose markers when registration fails, and reduce per-decoration allocation overhead. Co-authored-by: Cursor <cursoragent@cursor.com>
@xterm/addon-search
An addon for xterm.js that enables searching the buffer. This addon requires xterm.js v4+.
Install
npm install --save @xterm/addon-search
Usage
import { Terminal } from '@xterm/xterm';
import { SearchAddon } from '@xterm/addon-search';
const terminal = new Terminal();
const searchAddon = new SearchAddon();
terminal.loadAddon(searchAddon);
searchAddon.findNext('foo');
Search options
decorations: Highlight all matches and fireonDidChangeResultswith result counts.highlightLimit(constructor option): Caps how many matches are tracked/highlighted (default1000).incremental: Expands the current selection when the term still matches.wholeWord,regex,caseSensitive: Control match semantics.
See the full API for more advanced usage.