@@ -3,9 +3,10 @@ import { IDisposable, ITerminalOptions, Terminal } from "@xterm/xterm";
33import { ProgramRegistry , recurse_mount_and_register_with_output } from "./prog_registry" ;
44import type { AbstractFileSystem } from "./filesystem" ;
55
6- import type { KeyEvent , KeyEventHandler , RegisteredKeyEventIdentifier , Program } from "./types" ;
6+ import type { KeyEvent , KeyEventHandler , RegisteredKeyEventIdentifier } from "./types" ;
77import { register_builtin_key_handlers , change_prompt as change_prompt , register_builtin_fs_handlers } from "./event_handlers" ;
88import { SoundRegistry } from "./sfx_registry" ;
9+ import { AbstractWindowManager } from "./windowing" ;
910
1011export const NEWLINE = "\r\n" ;
1112/* eslint-disable-next-line no-control-regex, no-misleading-character-class */
@@ -106,6 +107,7 @@ export class WrappedTerminal extends Terminal {
106107 _prog_registry : ProgramRegistry ;
107108 _sfx_registry : SoundRegistry ;
108109 _fs : AbstractFileSystem ;
110+ _wm : AbstractWindowManager | null = null ;
109111
110112 _key_handlers : Map < RegisteredKeyEventIdentifier , { handler : KeyEventHandler , block : boolean } [ ] > = new Map ( ) ;
111113 _on_printable_handlers : KeyEventHandler [ ] = [ ] ;
@@ -127,6 +129,9 @@ export class WrappedTerminal extends Terminal {
127129 return this . _fs ;
128130 }
129131
132+ get_window_manager ( ) : AbstractWindowManager | null {
133+ return this . _wm ;
134+ }
130135
131136 get_variable ( name : string ) : string | undefined {
132137 return this . _vars . get ( name ) ;
@@ -674,12 +679,13 @@ export class WrappedTerminal extends Terminal {
674679 }
675680
676681 // be sure to call initialise after this
677- constructor ( fs : AbstractFileSystem , prog_registry ?: ProgramRegistry , sound_registry ?: SoundRegistry , xterm_opts ?: ITerminalOptions , register_builtin_handlers = true ) {
682+ constructor ( fs : AbstractFileSystem , prog_registry ?: ProgramRegistry , sound_registry ?: SoundRegistry , xterm_opts ?: ITerminalOptions , register_builtin_handlers = true , wm ?: AbstractWindowManager ) {
678683 super ( xterm_opts ) ;
679684
680685 this . _fs = fs ;
681686 this . _prog_registry = prog_registry || new ProgramRegistry ( ) ;
682687 this . _sfx_registry = sound_registry || new SoundRegistry ( ) ;
688+ this . _wm = wm || null ;
683689
684690 if ( register_builtin_handlers ) {
685691 register_builtin_key_handlers ( this ) ;
0 commit comments