Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
james-pre committed Oct 13, 2024
1 parent 82528f6 commit 5445f6d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import chalk from 'chalk';
import $ from 'jquery';
import { createShell } from 'utilium/shell.js';

const terminal = new Terminal({});
const terminal = new Terminal({
convertEol: true,
});
const fitAddon = new FitAddon();
terminal.loadAddon(fitAddon);
terminal.loadAddon(new WebLinksAddon());
Expand All @@ -28,14 +30,14 @@ for (const [name, script] of [
['cp', `fs.cpSync(args[0], args[1]);`],
['mv', `fs.renameSync(args[0], args[1]);`],
['rm', `fs.unlinkSync(args[0]);`],
['cat', String.raw`terminal.writeln(fs.readFileSync(args[0], 'utf8').replaceAll('\n', '\r\n'));`],
['cat', String.raw`terminal.writeln(fs.readFileSync(args[0], 'utf8'));`],
['pwd', `terminal.writeln(path.cwd);`],
['mkdir', `fs.mkdirSync(args[0]);`],
['echo', `terminal.writeln(args.join(' '));`],
['stat', `terminal.writeln('[work in progress]'/*inspect(fs.statSync(args[0]), { colors: true })*/)`],
]) {
fs.writeFileSync('/bin/' + name, script);
fs.chmodSync('/bin/' + name, 555);
fs.chmodSync('/bin/' + name, 0o555);
}

const exec_locals = { fs, path };
Expand Down

0 comments on commit 5445f6d

Please sign in to comment.