Valid column indices are 0 through cols - 1. The previous check used startCol > cols, so on an 80-column terminal column 80 was accepted while column 100 correctly threw. Use >= so the out-of-range guard matches the documented error for invalid search positions. 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');
See the full API for more advanced usage.