Loading static/js/jslinux.api.mjs +3 −1 Original line number Diff line number Diff line Loading @@ -148,7 +148,7 @@ export function onEnterPressed(handler) { * The command will then be executed, and the output will be shown in the terminal * @param {string} command A command to execute */ export function runCommand(command) { export async function runCommand(command) { const textarea = document.querySelector(".term_textarea") // We append \n to simulate the Enter press textarea.value = command + "\n" Loading @@ -156,6 +156,8 @@ export function runCommand(command) { // Now we just have to trigger an input event to activate the JSLinux event handler, see // https://thewebdev.info/2021/05/02/how-to-programmatically-trigger-a-change-event-on-an-input-with-javascript/ textarea.dispatchEvent(new Event("input")) // TODO Wait until a prompt is shown } /** Loading Loading
static/js/jslinux.api.mjs +3 −1 Original line number Diff line number Diff line Loading @@ -148,7 +148,7 @@ export function onEnterPressed(handler) { * The command will then be executed, and the output will be shown in the terminal * @param {string} command A command to execute */ export function runCommand(command) { export async function runCommand(command) { const textarea = document.querySelector(".term_textarea") // We append \n to simulate the Enter press textarea.value = command + "\n" Loading @@ -156,6 +156,8 @@ export function runCommand(command) { // Now we just have to trigger an input event to activate the JSLinux event handler, see // https://thewebdev.info/2021/05/02/how-to-programmatically-trigger-a-change-event-on-an-input-with-javascript/ textarea.dispatchEvent(new Event("input")) // TODO Wait until a prompt is shown } /** Loading