pub struct Shell { /* private fields */ }Expand description
VeridianOS Shell
Implementations§
Source§impl Shell
impl Shell
Sourcepub fn execute_command(&self, command_line: &str) -> CommandResult
pub fn execute_command(&self, command_line: &str) -> CommandResult
Execute a command line.
Supports &&, ||, ; operators, pipes (|), I/O redirections
(>, >>, <, <<<, 2>, 2>&1), variable expansion, alias
expansion, glob pattern expansion, command substitution ($(...)),
and subshell grouping ((cmd1; cmd2)).
Sourcepub fn init_console(&self) -> Result<(u32, u32), KernelError>
pub fn init_console(&self) -> Result<(u32, u32), KernelError>
Initialize the console device by creating a PTY pair.
Creates a PTY master/slave pair via the PTY manager and optionally sets the terminal size. Shell output can then be routed through the PTY slave while falling back to serial when PTY is unavailable.
Returns Ok((master_id, slave_id)) on success.
Sourcepub fn set_cwd(&self, path: String) -> Result<(), KernelError>
pub fn set_cwd(&self, path: String) -> Result<(), KernelError>
Set current working directory
Sourcepub fn get_all_env(&self) -> Vec<String>
pub fn get_all_env(&self) -> Vec<String>
Get all environment variables
Sourcepub fn register_builtin(&self, command: Box<dyn BuiltinCommand>)
pub fn register_builtin(&self, command: Box<dyn BuiltinCommand>)
Register a builtin command (public API for external modules)
Sourcepub fn register_builtins_batch(&self, commands: Vec<Box<dyn BuiltinCommand>>)
pub fn register_builtins_batch(&self, commands: Vec<Box<dyn BuiltinCommand>>)
Register multiple builtin commands at once