- Reworked internal signals
- Separated input passing from signal calling - Exposed command registry to the broader codebase - Moved command execution call to internal shell logic - TTY is now expected to watch for stdout escape sequences to perform tasks
This commit is contained in:
@@ -9,6 +9,7 @@ export interface ShellState {
|
||||
readonly users: ReadonlyMap<number, UserInfo>;
|
||||
readonly groups: ReadonlyMap<number, GroupInfo>;
|
||||
readonly sessionStack: ReadonlyArray<SessionState>;
|
||||
//readonly commmandRegistry: CommandRegistry;
|
||||
}
|
||||
|
||||
export function createInitialShellState(
|
||||
@@ -16,12 +17,14 @@ export function createInitialShellState(
|
||||
users: ReadonlyMap<number, UserInfo>,
|
||||
groups: ReadonlyMap<number, GroupInfo>,
|
||||
user: UserInfo,
|
||||
//commandRegistry: CommandRegistry,
|
||||
): ShellState {
|
||||
return Object.freeze({
|
||||
filesystem,
|
||||
users,
|
||||
groups,
|
||||
sessionStack: Object.freeze([createInitialSessionState(user)]),
|
||||
//commandRegistry,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -63,7 +66,7 @@ export function withCwd(state: ShellState, ptr: NodePointer): ShellState {
|
||||
} satisfies ShellState);
|
||||
}
|
||||
|
||||
export function withHistory(state: ShellState, input: string): ShellState {
|
||||
export function withHistory(state: ShellState, input: Uint8Array): ShellState {
|
||||
const session = getCurrentSession(state);
|
||||
|
||||
const newSession = Object.freeze({
|
||||
|
||||
Reference in New Issue
Block a user