feat(app): load xterm search addon + surface→addon registry

This commit is contained in:
2026-06-10 12:35:41 +07:00
parent daf87d3c09
commit 52a502c38b
4 changed files with 33 additions and 1 deletions
+17
View File
@@ -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);
}