Loading static/js/jslinux.api.mjs +16 −3 Original line number Diff line number Diff line Loading @@ -117,9 +117,7 @@ export function getTerminalContents(includeLastInteraction) { const contents = [] let currentInteraction = {} Array .from(document.querySelectorAll(".term_content div")) .map(div => sanitize(div.textContent)) getRawTerminalContents() .filter(line => line !== " ") .map(parseAsPromptOrOutput) .forEach(parsed => { Loading @@ -138,6 +136,21 @@ export function getTerminalContents(includeLastInteraction) { return contents } /** * Get the raw contents of the terminal area that are currently visible (without scrolling). * * Returns a list containing every line (even empty ones) of the visible terminal area. * Just like getTerminalContents(), the lines are sanitized so that non-breaking spaces are * replaced with normal spaces. * * @returns List of strings ["firstVisibleLine", "secondVisibleLine", ..., "lastVisibleLine"] */ export function getRawTerminalContents() { return Array .from(document.querySelectorAll(".term_content div")) .map(div => sanitize(div.textContent)) } /** * Return if the vm is currently loading, i.e. not accepting commands */ Loading Loading
static/js/jslinux.api.mjs +16 −3 Original line number Diff line number Diff line Loading @@ -117,9 +117,7 @@ export function getTerminalContents(includeLastInteraction) { const contents = [] let currentInteraction = {} Array .from(document.querySelectorAll(".term_content div")) .map(div => sanitize(div.textContent)) getRawTerminalContents() .filter(line => line !== " ") .map(parseAsPromptOrOutput) .forEach(parsed => { Loading @@ -138,6 +136,21 @@ export function getTerminalContents(includeLastInteraction) { return contents } /** * Get the raw contents of the terminal area that are currently visible (without scrolling). * * Returns a list containing every line (even empty ones) of the visible terminal area. * Just like getTerminalContents(), the lines are sanitized so that non-breaking spaces are * replaced with normal spaces. * * @returns List of strings ["firstVisibleLine", "secondVisibleLine", ..., "lastVisibleLine"] */ export function getRawTerminalContents() { return Array .from(document.querySelectorAll(".term_content div")) .map(div => sanitize(div.textContent)) } /** * Return if the vm is currently loading, i.e. not accepting commands */ Loading