Files
bare-operating-system/packages/bare-os-seeder/kernel/bin/clear
T
Raven Scott 5991f4f8e8
CI / test (push) Failing after 4m58s
FISH style
2026-04-02 22:57:23 -04:00

20 lines
541 B
Plaintext

/** Shared helpers for drive-resident /bin scripts (prepended before each command). */
function bareStdin(ctx) {
return typeof ctx.shellStdin === 'string' ? ctx.shellStdin : ''
}
async function run(ctx, argv) {
const seq = '\x1b[H\x1b[2J\x1b[3J'
if (typeof ctx.writeScreen === 'function') {
ctx.writeScreen(seq)
return
}
globalThis.console.clear?.()
const ps = globalThis.process?.stdout
if (ps && typeof ps.write === 'function') {
ps.write(seq)
return
}
for (let i = 0; i < 48; i++) ctx.console.log('')
}