diff --git a/src/emulator/commands/index.js b/src/emulator/commands/index.js index 4ab817b..e4b0603 100644 --- a/src/emulator/commands/index.js +++ b/src/emulator/commands/index.js @@ -10,6 +10,7 @@ let cmds = { 'export_file': require('./export_file'), 'import_file': require('./import_file'), 'zsh': require('./zsh'), + 'ps': require('./ps'), // alias l='ls -l' 'l': (a,t) => {require('./ls')([...a, '-l'], t)}, diff --git a/src/emulator/commands/ps.js b/src/emulator/commands/ps.js new file mode 100644 index 0000000..ad1947b --- /dev/null +++ b/src/emulator/commands/ps.js @@ -0,0 +1,20 @@ +const { Terminal } = require("xterm"); + +/** + * + * @param {string[]} argv + * @param {Terminal} terminal + */ +module.exports = (argv, terminal) => { + if (argv.indexOf('--help') != -1) { + terminal.write( +`Usage: ${argv[0]} [OPTIONS] +Show current process list`); + return; + } + terminal.write( +`\tPID\tTTY\tTIME\tCMD + 42\tpts/0\t00:00:00\tzsh + 43\tpts/0\t00:00:00\tps +`); +} \ No newline at end of file