Skip to main content

execstring

Function execstring 

Source
pub fn execstring(s: &str, _dont_change_job: i32, _exiting: i32, _context: &str)
Expand description

Port of void execstring(char *s, int dont_change_job, int exiting, char *context) from Src/exec.c:1228.

C body:

Eprog prog;
pushheap();
if (isset(VERBOSE)) {
    zputs(s, stderr);
    fputc('\n', stderr);
    fflush(stderr);
}
if ((prog = parse_string(s, 0)))
    execode(prog, dont_change_job, exiting, context);
popheap();

Public entry — execute an arbitrary string as a zsh command list. Called by eval, ./source, trap action firing, autoload body executors, command substitution body runners.

§=================== WARNING — DIVERGENCE ==================== The C path is parse_stringexecodeexeclist (wordcode walker). zshrs replaces execode/execlist with the fusevm bytecode VM at crate::vm_helper::ShellExecutor::execute_script_zsh_pipeline. Faithful port: VERBOSE banner + pushheap/popheap intact; the parse+execute chain delegates to the fusevm entry. When execlist lands as a strict 1:1 port, swap the delegate for the canonical chain.