Newest Commit - code same as last commit

This commit is contained in:
2026-02-08 10:42:58 +01:00
parent 7852a77a7c
commit ef09b642d6
64 changed files with 35 additions and 14 deletions
Regular → Executable
View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
+12 -12
View File
@@ -65,6 +65,16 @@ export class Bash {
this.vfs = new VirtualFS({ fs: args.fs, user: args.user });
}
private _appendNewResult(inode: number, output: any, cmd: string) {
const data: PrintData = {
path: this.vfs.formatPath(this.vfs.getPathByInode(inode)),
output: output,
cmd: cmd
};
console.log(data);
this._terminal.PrintOutput(data);
}
updateHistory(input: string): void {
if ((this.user.history.length = 255)) {
this.user.history.unshift(...this.user.history.splice(-1));
@@ -107,14 +117,14 @@ export class Bash {
if (command.root) {
if (this.hasSudoPerms(this.user.uid)) {
let out: Result = command.method.call(this, args);
this.appendNewResult(this.getCwd(), out, this.user.history[0]);
this._appendNewResult(this.getCwd(), out, this.user.history[0]);
}
this.throwError(result);
}
let out: Result = command.method.call(this, args);
console.log(out);
this.appendNewResult(out.path, out.data?.data, this.user.history[0]);
this._appendNewResult(out.path, out.data?.data, this.user.history[0]);
}
throwError(result: Result): void {
@@ -134,16 +144,6 @@ export class Bash {
}
}
private appendNewResult(inode: number, output: any, cmd: string) {
const data: PrintData = {
path: this.vfs.formatPath(this.vfs.getPathByInode(inode)),
output: output,
cmd: cmd
};
console.log(data);
this._terminal.PrintOutput(data);
}
formatBytes(bytes: number, dPoint?: number, pow: 1024 | 1000 = 1024): string {
if (!+bytes) return '0';
View File
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
Regular → Executable
View File
View File
Regular → Executable
View File
+8
View File
@@ -110,6 +110,14 @@ export class Terminal {
return this.bash.getUser();
}
getTerminalWidth(): number {
const width = this.callbacks.getWidth?.();
if(!width) { throw new Error('somehow width is undefined still after all the checks'); }
console.log(width);
return width;
}
getCwd(): string {
const fs: VirtualFS = this.bash.getFs();
console.log(fs.getPathByInode(this.bash.getCwd()));
Regular → Executable
View File