Fix nested commands in interactive mode triggering prompt2 (issue #19)

Save and restore cmd_mode across interpolation parsing so that
luaX_readcommandcont resumes in the correct mode after a nested
backtick command inside ${...}.
This commit is contained in:
Cormac Shannon
2026-03-05 00:13:34 +00:00
parent b3aa1d9c63
commit c96fae90c0
4 changed files with 12 additions and 1 deletions

1
llex.h
View File

@@ -83,6 +83,7 @@ typedef struct LexState {
TString *brkn; /* "break" name (used as a label) */
TString *glbn; /* "global" name (when not a reserved word) */
lu_byte cmd_mode; /* 0=normal, 1=backtick command, 2=interactive command */
lu_byte saved_cmd_mode; /* cmd_mode to restore after interpolation */
} LexState;