Files
lush/issues/19-nested-commands-prompt2.md
Cormac Shannon c96fae90c0 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 ${...}.
2026-03-05 00:13:34 +00:00

388 B

19 — Nested commands in interactive mode trigger prompt2

Status: done

Running nested commands in an interactive command drops into prompt2 when it shouldn't:

~/Code/20251000_lush> !echo ${`ls`.stdout}
>>

The parser sees the opening { and thinks the expression is incomplete, waiting for more input. The nested backtick command should be parsed and evaluated inline.