- Fixed sort.ts

- Fixed `cd`
This commit is contained in:
2026-11-10 13:13:38 +01:00
parent 00200b4c75
commit 492f1ba372
7 changed files with 160 additions and 98 deletions
+3 -2
View File
@@ -1,4 +1,5 @@
import type { FileSystem } from "./filesystem/filesystem";
import type { NodePointer } from "./filesystem/node";
import { addHistoryEntry } from "./history_state";
import type { GroupInfo, UserInfo } from "./session_manager";
import { createInitialSessionState, getCurrentSession, type SessionState } from "./session_manager";
@@ -38,14 +39,14 @@ export function createShellState(
});
}
export function withCwd(state: ShellState, inode: number): ShellState {
export function withCwd(state: ShellState, ptr: NodePointer): ShellState {
const session = getCurrentSession(state);
const newSession = Object.freeze({
user: session.user,
envVars: Object.freeze(session.envVars),
history: Object.freeze(session.history),
cwd: inode,
cwd: ptr,
pwd: session.cwd,
exitCode: session.exitCode,
} satisfies SessionState);