Skip to content

fix(mermaid): pass command as list to jobstart#46

Open
charlesg3 wants to merge 1 commit into
3rd:masterfrom
charlesg3:fix/mermaid-jobstart-list
Open

fix(mermaid): pass command as list to jobstart#46
charlesg3 wants to merge 1 commit into
3rd:masterfrom
charlesg3:fix/mermaid-jobstart-list

Conversation

@charlesg3

@charlesg3 charlesg3 commented Mar 15, 2026

Copy link
Copy Markdown

Summary

  • Pass command_parts list directly to vim.fn.jobstart() instead of concatenating into a string with table.concat()
  • Avoids shell interpretation that breaks # in hex colors (treated as comments) and spaces in file paths
  • Follows :help jobstart() recommendation: passing a List runs the command directly without shell

Fixes #45
Also fixes #11 — hex background colors no longer need extra quoting

When command_parts is concatenated into a string, vim.fn.jobstart()
runs it through the shell. This breaks arguments containing shell
metacharacters — for example the '#' in hex color values like
'#1A1B1C' passed via -b (background) is interpreted as a comment,
silently dropping the color and all subsequent arguments. Spaces in
file paths or cli_args values would also cause incorrect splitting.

Passing command_parts as a list makes jobstart() execute the command
directly without shell interpretation, per :help jobstart().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mermaid renderer breaks on background colors and paths with special characters Hex background color require quotes around to work

1 participant