Revert "more things broken for now"

This reverts commit 6cc9727091.
This commit is contained in:
2026-09-03 23:22:17 +02:00
parent 6cc9727091
commit 776a93e21b
4 changed files with 14 additions and 35 deletions
+3 -14
View File
@@ -1,4 +1,4 @@
import { type DirectoryNode } from "@core/filesystem/treenode";
import { COMMAND_REGISTRY } from "@core/command_registry";
import { createErrorResult, type Result } from "@core/result";
import { getCurrentSession } from "@core/session_manager";
import { withExitCode, withHistory, type ShellState } from "@core/shell_state";
@@ -6,7 +6,6 @@ import { SIGNAL_MAP } from "@core/signal";
import type { ShellError } from "@core/util/errors";
import { createImmutableBuffer } from "@core/util/immutable_buffer";
import { tokenize } from "@core/util/parser";
import { resolvePath } from "@core/util/path_resolver";
import { EventEmitter } from "./event_emitter";
import { ProcessManager } from "./process_manager";
@@ -64,12 +63,7 @@ export class Shell {
if (!parsed[0]) return;
this._State = withHistory(this._State, input);
const inode = resolvePath(this._State, this._State.env.get("PATH")!);
const node = this._State.filesystem.getNode(inode) as DirectoryNode;
const command = node.children[parsed[0]];
//const command = COMMAND_REGISTRY.get(parsed[0]);
const command = COMMAND_REGISTRY.get(parsed[0]);
if (!command) {
const encoded = new TextEncoder().encode(`Command ${parsed[0]} not found`);
@@ -88,7 +82,7 @@ export class Shell {
return;
}
if (this._State.filesystem.canExecute(command, getCurrentSession(this._State).user)) {
if (command.requiresRoot && getCurrentSession(this._State).user.uid != 0) {
const result = createErrorResult(
"PermissionDenied",
`Permission Denied`,
@@ -101,11 +95,6 @@ export class Shell {
return;
}
const bin = this._State.filesystem.getNode(command);
// read file content
// try to serialize it to a function
// call that function with a new process
parsed.shift();
const pid = this._ProcessManager.createProcess(this._State, command, parsed);