feat: 终端内搜索.
This commit is contained in:
@@ -7,7 +7,7 @@ import { InputProtocol } from '../types/terminal.protocol';
|
||||
import { ITerminalOptions, Terminal } from 'xterm';
|
||||
import { FitAddon } from 'xterm-addon-fit';
|
||||
import { WebLinksAddon } from 'xterm-addon-web-links';
|
||||
import { SearchAddon } from 'xterm-addon-search';
|
||||
import { ISearchOptions, SearchAddon } from 'xterm-addon-search';
|
||||
import { ImageAddon } from 'xterm-addon-image';
|
||||
import { CanvasAddon } from 'xterm-addon-canvas';
|
||||
import { WebglAddon } from 'xterm-addon-webgl';
|
||||
@@ -235,6 +235,15 @@ export default class TerminalSession implements ITerminalSession {
|
||||
return selection;
|
||||
}
|
||||
|
||||
// 查找
|
||||
find(word: string, next: boolean, options: ISearchOptions): void {
|
||||
if (next) {
|
||||
this.addons.search.findNext(word, options);
|
||||
} else {
|
||||
this.addons.search.findPrevious(word, options);
|
||||
}
|
||||
}
|
||||
|
||||
// 去顶部
|
||||
toTop(): void {
|
||||
this.inst.scrollToTop();
|
||||
|
||||
Reference in New Issue
Block a user