@@ -4,6 +4,7 @@ import { ICommandLine } from './command_line';
44import { IRunContext } from './context' ;
55import { CommandNode , parse } from './parse' ;
66import { ITabCompleteResult , PathType } from './tab_complete' ;
7+ import { Termios } from './termios' ;
78import { RuntimeExports } from './types/wasm_module' ;
89import { longestStartsWith , toColumns } from './utils' ;
910
@@ -13,7 +14,8 @@ export class TabCompleter {
1314 */
1415 constructor (
1516 readonly context : IRunContext ,
16- readonly enableBufferedStdinCallback : IEnableBufferedStdinCallback
17+ readonly enableBufferedStdinCallback : IEnableBufferedStdinCallback ,
18+ readonly termios : Termios . Termios
1719 ) { }
1820
1921 async complete ( commandLine : ICommandLine ) : Promise < ICommandLine > {
@@ -205,7 +207,7 @@ export class TabCompleter {
205207 workerIO . write ( '\n' + prompt ) ;
206208
207209 await this . enableBufferedStdinCallback ( true ) ;
208- workerIO . termios . setRawMode ( ) ;
210+ this . termios . setRawMode ( ) ;
209211
210212 let ret = false ;
211213 let haveResponse = false ;
@@ -224,7 +226,7 @@ export class TabCompleter {
224226 }
225227 }
226228
227- workerIO . termios . setDefaultShell ( ) ;
229+ this . termios . setDefaultShell ( ) ;
228230 await this . enableBufferedStdinCallback ( false ) ;
229231 return ret ;
230232 }
0 commit comments