Repository navigation
v0.1.577
fix(serve): let a quoted LLMMAN_SHELL argument hold a space (#701)
This PR lets an argument in LLMMAN_SHELL hold a space by quoting it, with the same splitter as LLMMAN_*_ARGS
It used to split on whitespace only, so sh -c 'exec tmux new -A' reached the shell as 'exec, tmux, new and -A'. Now an argument that starts with ' or " runs to the matching quote and loses the quotes: sh -c 'exec tmux new -A' gives exec tmux new -A, and a quoted path with spaces ("C:\Program Files\Git\bin\bash.exe" -l) works.
Quotes inside an argument, backslashes and # pass through as before, and off, on and unset are unaffected. The quote must start the argument, as in LLMMAN_*_ARGS.
Behaviour change: an LLMMAN_SHELL argument that starts with a quote is now grouped and its quotes removed. One whose quote never closes stops llmman serve at startup, right after the LLMMAN_*_ARGS check and before the store is touched, with e.g. LLMMAN_SHELL: missing closing quote for the ' at character 7. Arguments that don't start with a quote are unaffected.
Related to #691