feat(app): load xterm search addon + surface→addon registry
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import type { SearchAddon } from "@xterm/addon-search";
|
||||
|
||||
/** Maps a surfaceId to its terminal's SearchAddon so the search bar can reach
|
||||
* the focused panel without prop-drilling through the layout tree. */
|
||||
const registry = new Map<string, SearchAddon>();
|
||||
|
||||
export function registerSearch(surfaceId: string, addon: SearchAddon): void {
|
||||
registry.set(surfaceId, addon);
|
||||
}
|
||||
|
||||
export function unregisterSearch(surfaceId: string): void {
|
||||
registry.delete(surfaceId);
|
||||
}
|
||||
|
||||
export function getSearch(surfaceId: string): SearchAddon | undefined {
|
||||
return registry.get(surfaceId);
|
||||
}
|
||||
Reference in New Issue
Block a user