Skip to content

Commit 259877b

Browse files
committed
fix: allow ETX to propagate to bash
1 parent 08601ae commit 259877b

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/phoenix/src/ansi-shell/pipeline/Pipeline.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,9 @@ export class PreparedCommand {
200200
}
201201
};
202202

203-
in_ = new SignalReader({ delegate: in_, sig });
203+
if ( ! command.no_signal_reader ) {
204+
in_ = new SignalReader({ delegate: in_, sig });
205+
}
204206

205207
if ( command.input?.syncLines ) {
206208
in_ = new SyncLinesReader({ delegate: in_ });

src/phoenix/src/puter-shell/providers/EmuCommandProvider.js

+10
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ export class EmuCommandProvider {
112112
name: id,
113113
path: 'Emulator',
114114
execute: this.execute.bind(this, { id, emu, ctx }),
115+
no_signal_reader: true,
115116
}
116117
}
117118

@@ -128,6 +129,15 @@ export class EmuCommandProvider {
128129
};
129130
ctx.shell.addEventListener('signal.window-resize', resize_listener);
130131

132+
// Note: this won't be triggered because the signal reader is disabled,
133+
// but if we ever need to enable it here this might be useful.
134+
// ctx.externs.sig.on(signal => {
135+
// if ( signal === signals.SIGINT ) emu.postMessage({
136+
// $: 'stdin',
137+
// data: '\x03', // ETX
138+
// });
139+
// })
140+
131141
// TODO: handle CLOSE -> emu needs to close connection first
132142
const app_close_promise = new TeePromise();
133143
const sigint_promise = new TeePromise();

0 commit comments

Comments
 (0)