Skip to content

Commit 00b0a11

Browse files
committed
Fix termios access
1 parent 0f6d558 commit 00b0a11

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/shell_impl.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ export class ShellImpl implements IShellImpl {
9797

9898
this._tabCompleter = new TabCompleter(
9999
this._runContext,
100-
this._options.enableBufferedStdinCallback
100+
this._options.enableBufferedStdinCallback,
101+
this._options.termios
101102
);
102103
}
103104

src/tab_completer.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { ICommandLine } from './command_line';
44
import { IRunContext } from './context';
55
import { CommandNode, parse } from './parse';
66
import { ITabCompleteResult, PathType } from './tab_complete';
7+
import { Termios } from './termios';
78
import { RuntimeExports } from './types/wasm_module';
89
import { 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

Comments
 (0)