Commit ca279041 authored by Jakob Moser's avatar Jakob Moser
Browse files

Add isVmLoading function

parent 0b375864
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -136,6 +136,14 @@ export function getTerminalContents(includeLastInteraction) {
    return contents
}

/**
 * Return if the vm is currently loading, i.e. not accepting commands
 */
export function isVmLoading() {
    const contents = getTerminalContents(true)
    return contents.length === 1 && contents[0].prompt === null && contents[0].input === null && contents[0].output[0] == "Loading..."
}

/**
 * Return the current prompt, or null, if no prompt is currently shown
 */