Implement prefix-based interactive commands via ! (issue #14)
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=""}.
This commit is contained in:
2
linit.c
2
linit.c
@@ -71,6 +71,8 @@ static int luaB_setenv (lua_State *L) {
|
||||
static void opencommand (lua_State *L) {
|
||||
lua_pushcfunction(L, luaB_command);
|
||||
lua_setglobal(L, "__command");
|
||||
lua_pushcfunction(L, luaB_interactive);
|
||||
lua_setglobal(L, "__interactive");
|
||||
lua_pushcfunction(L, luaB_getenv);
|
||||
lua_setglobal(L, "__getenv");
|
||||
lua_pushcfunction(L, luaB_setenv);
|
||||
|
||||
Reference in New Issue
Block a user