UNPKG

runtime-shell

Version:

Some useful shell commands for runtime.js

18 lines (15 loc) 439 B
'use strict'; const tty = require('runtimejs/js/core/tty'); module.exports = function(runtime, parseArgs) { runtime.shell.setCommand('clear', function(args, env, cb) { // TODO: print according to screen height. env.stdio.setColor('black'); env.stdio.setBackgroundColor('black'); for (var i = 0; i < 80; i++) { env.stdio.write('\n'); } env.stdio.setColor('white'); tty.moveTo(0, 0); cb(0); }); }