Extract lookup_lush_func() in lcmd.c to deduplicate the registry lookup
pattern shared by try_builtin and exec_user_command. Move exec_user_command
after exec_failed to group helpers together. Move codeenvget definition in
lparser.c to replace its forward declaration.
Aliases rewrite the command string before pipeline splitting, so alias
values may contain pipes (e.g. lush.aliases.foo = "echo hi |"). Expansion
happens once per dispatch to prevent recursion.
VM now resolves lush functions via luaH_getshortstr through interned
TString pointers, so wrapping lush.command = my_wrapper is transparently
picked up. The lush table no longer has integer-keyed duplicates.
Register luaopen_lush() in stdlibs so the lush table is available as a
global. Users can now extend the shell by adding functions to
lush.builtins. The OP_LUSH VM access via integer keys is preserved.
Add $() for inline subcommand substitution that runs a command and
inserts its stdout (trailing newlines stripped) into the outer command
string. Supports nesting, and mixing with ${expr} and $NAME.
Store __command, __interactive, __getenv, __setenv as upvalues
populated by lua_load() from the registry, keeping them invisible
to user code while accessible to the parser's codegen.
Unquoted tokens are now expanded through a tilde → brace → glob pipeline
in parse_argv. Quoted tokens (single, double, or backslash) suppress all
expansion. Uses glob(3) with GLOB_NOCHECK for wildcard matching and manual
implementations for tilde (~→$HOME) and brace ({a,b,c}) expansion.
Add !command syntax that runs commands with inherited terminal (no
capture). The lexer treats ! as a statement-starting token, reading
to end-of-line with the same interpolation/escape/pipe support as
backtick commands. The C function sets _ = {code=N, stdout="", stderr=""}.
Add split_pipeline() to split command strings on unquoted | and
exec_pipeline() to fork N children connected by inter-stage pipes.
Only the last stage's stdout/stderr are captured; middle stages'
stderr is inherited. Exit code comes from the last stage.
Implements luaB_command: fork/execvp with pipe-captured stdout/stderr,
argv parsing with quoting/escaping, and non-blocking pipe reading via
select(). Backs the __command() calls emitted by the backtick parser.
Resolves#03 and #04.