Loading static/js/jslinux.api.mjs +17 −0 Original line number Diff line number Diff line Loading @@ -206,6 +206,23 @@ async function pressEnter() { await prompt() } /** * Simulates pressing Ctrl+C to send a SIGINT command to the currently running process * * @param {boolean} waitForPrompt If true, wait until a prompt is shown, if false, exit immediately */ export async function abort(waitForPrompt) { const textarea = document.querySelector(".term_textarea") textarea.dispatchEvent(new KeyboardEvent("keydown", { keyCode: 67, ctrlKey: true })) if(waitForPrompt) { await prompt() } } /** * Types the given command into the terminal and simulates an Enter press * The command will then be executed, and the output will be shown in the terminal Loading Loading
static/js/jslinux.api.mjs +17 −0 Original line number Diff line number Diff line Loading @@ -206,6 +206,23 @@ async function pressEnter() { await prompt() } /** * Simulates pressing Ctrl+C to send a SIGINT command to the currently running process * * @param {boolean} waitForPrompt If true, wait until a prompt is shown, if false, exit immediately */ export async function abort(waitForPrompt) { const textarea = document.querySelector(".term_textarea") textarea.dispatchEvent(new KeyboardEvent("keydown", { keyCode: 67, ctrlKey: true })) if(waitForPrompt) { await prompt() } } /** * Types the given command into the terminal and simulates an Enter press * The command will then be executed, and the output will be shown in the terminal Loading