- implemented the rest of long-format compatible ls flags

- split path_resolver functions to 3 separate functions that prioritize different points of relativity
- added a `convertToUnit`function to convert from bytes to higher units of messurement
- revert change: excluded inode 0 from tree traversal results
This commit is contained in:
2026-08-30 17:35:20 +02:00
parent 4776232377
commit 8e054a220d
5 changed files with 243 additions and 108 deletions
+3 -3
View File
@@ -14,7 +14,7 @@ import { FileSystem } from "@core/filesystem/filesystem";
import type { TreeNode } from "@core/filesystem/treenode";
import { getCurrentSession, type GroupInfo, type UserInfo } from "@core/session_manager";
import { createInitialShellState, type ShellState } from "@core/shell_state";
import { resolveInode } from "@core/util/path_resolver";
import { resolveInodeToHome } from "@core/util/path_resolver";
import { deserializeFileSystem } from "@shell/serializer";
import { Shell } from "@shell/shell";
import { printTree } from "./util/tree_visualizer";
@@ -56,7 +56,7 @@ await Shell.init(state);
Shell.Instance?.on("result", payload => {
const decoded = new TextDecoder().decode(payload.result.stdout.toArray());
process.stdout.write(decoded + "\n");
process.stdout.write(resolveInode(payload.state, getCurrentSession(payload.state).cwd) + "\n> ");
process.stdout.write(resolveInodeToHome(payload.state, getCurrentSession(payload.state).cwd) + "\n> ");
});
/*
@@ -71,7 +71,7 @@ Shell.Instance?.on("result", payload => {
}); */
//console.clear();
process.stdout.write(resolveInode(state, getCurrentSession(state).cwd) + "\n> ");
process.stdout.write(resolveInodeToHome(state, getCurrentSession(state).cwd) + "\n> ");
process.stdin.on("data", async data => {
if (Shell.Instance?.BoundPID !== null) {
Shell.Instance?.sendInput(data.toString().trim());