- fixed 'I' command in normal mode not moving to exact start of line

- Added disown builtin
- Fixed job table not hanging up child processes on exit
- Added target architecture and os to --version output
- Added local builtin for creating variables scoped to functions
This commit is contained in:
2026-02-23 16:10:49 -05:00
parent 1a44a783e0
commit aed0e6fb8c
10 changed files with 205 additions and 17 deletions

34
src/builtin/eval.rs Normal file
View File

@@ -0,0 +1,34 @@
use nix::{errno::Errno, unistd::execvpe};
use crate::{
builtin::setup_builtin,
jobs::JobBldr,
libsh::error::ShResult,
parse::{NdRule, Node, execute::exec_input},
procio::IoStack,
state,
};
pub fn eval(node: Node, io_stack: &mut IoStack, job: &mut JobBldr) -> ShResult<()> {
let NdRule::Command {
assignments: _,
argv,
} = node.class
else {
unreachable!()
};
let (expanded_argv, _guard) = setup_builtin(argv, job, Some((io_stack, node.redirs)))?;
if expanded_argv.is_empty() {
state::set_status(0);
return Ok(());
}
let joined_argv = expanded_argv.into_iter()
.map(|(s, _)| s)
.collect::<Vec<_>>()
.join(" ");
exec_input(joined_argv, None, false)
}