Fix #1840 - Do not bootstrap interactive shell (#1846)

This commit is contained in:
Andrea Giammarchi
2023-11-07 19:22:08 +01:00
committed by GitHub
parent f1a46be738
commit 2d50ca86a6
5 changed files with 21 additions and 27 deletions

View File

@@ -98,12 +98,6 @@ const pyTerminal = async () => {
});
};
// at the end of the code, make the terminal interactive
const codeAfter = `
import code as _code
_code.interact()
`;
// add a hook on the main thread to setup all sync helpers
// also bootstrapping the XTerm target on main
hooks.main.onWorker.add(function worker(_, xworker) {
@@ -118,14 +112,12 @@ const pyTerminal = async () => {
// allow a worker to drop main thread hooks ASAP
xworker.sync.pyterminal_drop_hooks = () => {
hooks.worker.onReady.delete(workerReady);
hooks.worker.codeAfterRun.delete(codeAfter);
};
});
// setup remote thread JS/Python code for whenever the
// worker is ready to become a terminal
hooks.worker.onReady.add(workerReady);
hooks.worker.codeAfterRun.add(codeAfter);
} else {
// in the main case, just bootstrap XTerm without
// allowing any input as that's not possible / awkward