Make web-shell work when changing directories

This commit is contained in:
blinry 2023-09-07 18:22:13 +02:00
parent 2f115c99d4
commit a1bb607c7e

View file

@ -56,7 +56,7 @@ function run(cmd) {
if (output.endsWith("# ")) { if (output.endsWith("# ")) {
emulator.remove_listener("serial0-output-char", listener) emulator.remove_listener("serial0-output-char", listener)
let outputWithoutPrompt = output.slice(0, -4) let outputWithoutPrompt = output.slice(0, -3)
let outputWithoutFirstLine = outputWithoutPrompt.slice( let outputWithoutFirstLine = outputWithoutPrompt.slice(
outputWithoutPrompt.indexOf("\n") + 1 outputWithoutPrompt.indexOf("\n") + 1
) )
@ -114,6 +114,7 @@ function boot() {
// Wait for the emulator to start, then resolve the promise. // Wait for the emulator to start, then resolve the promise.
var interval = setInterval(() => { var interval = setInterval(() => {
if (emulator.is_running()) { if (emulator.is_running()) {
run("PS1='# '")
clearInterval(interval) clearInterval(interval)
resolve(true) resolve(true)
} }