Skip to content

Commit

Permalink
Added terminal scroll
Browse files Browse the repository at this point in the history
Fix `export {}` in commands breaking type reference.
  • Loading branch information
james-pre committed Oct 16, 2024
1 parent af62c7c commit bd00937
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 13 deletions.
3 changes: 2 additions & 1 deletion commands/cat.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export {};
/// <reference types="./lib.d.ts" />
// @ts-check
export {};

if (!args[1]) {
throw 'No path provided';
}
Expand Down
2 changes: 1 addition & 1 deletion commands/cd.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export {};
/// <reference types="./lib.d.ts" />
// @ts-check
export {};
__open(args[1] || path.resolve('.'), true);
2 changes: 1 addition & 1 deletion commands/chmod.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export {};
/// <reference types="./lib.d.ts" />
// @ts-check
export {};

const [command, mode, filePath] = args;

Expand Down
2 changes: 1 addition & 1 deletion commands/cp.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export {};
/// <reference types="./lib.d.ts" />
// @ts-check
export {};
if (args.length != 3) {
throw 'Incorrect number of arguments';
}
Expand Down
2 changes: 1 addition & 1 deletion commands/echo.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export {};
/// <reference types="./lib.d.ts" />
// @ts-check
export {};
terminal.writeln(args.slice(1).join(' '));
2 changes: 1 addition & 1 deletion commands/help.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export {};
/// <reference types="./lib.d.ts" />
// @ts-check
export {};
terminal.writeln('Some unix commands available, ls /bin to see them.');
2 changes: 1 addition & 1 deletion commands/ln.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export {};
/// <reference types="./lib.d.ts" />
// @ts-check
export {};

// Argument parsing
const positionals = args.filter(arg => !arg.startsWith('-')).slice(1);
Expand Down
2 changes: 1 addition & 1 deletion commands/mkdir.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export {};
/// <reference types="./lib.d.ts" />
// @ts-check
export {};
if (!args[1]) {
throw 'No path provided';
}
Expand Down
2 changes: 1 addition & 1 deletion commands/mv.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export {};
/// <reference types="./lib.d.ts" />
// @ts-check
export {};
if (args.length != 3) {
throw 'Incorrect number of arguments';
}
Expand Down
2 changes: 1 addition & 1 deletion commands/open-editor.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export {};
/// <reference types="./lib.d.ts" />
// @ts-check
export {};
__editor_open(args[1]);
2 changes: 1 addition & 1 deletion commands/pwd.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export {};
/// <reference types="./lib.d.ts" />
// @ts-check
export {};
terminal.writeln(path.cwd);
2 changes: 1 addition & 1 deletion commands/rm.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export {};
/// <reference types="./lib.d.ts" />
// @ts-check
export {};
if (!args[1]) {
throw 'No path provided';
}
Expand Down
2 changes: 1 addition & 1 deletion commands/touch.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export {};
/// <reference types="./lib.d.ts" />
// @ts-check
export {};
if (!args[1]) {
throw 'No path provided';
}
Expand Down
1 change: 1 addition & 0 deletions src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ dialog {
#terminal-container {
position: absolute;
inset: 5em 1em 1em;
overflow-y: scroll;
}

dialog.page {
Expand Down

0 comments on commit bd00937

Please sign in to comment.