fix(cli): add missing shell metacharacters (\n, \r, \t, \\) to escape regex

This commit is contained in:
MD. MOHIBUR RAHMAN
2026-02-24 04:14:54 +06:00
parent 926afab788
commit 5b3819073f
2 changed files with 8 additions and 1 deletions
@@ -27,7 +27,7 @@ const FS_COMPLETION_DEBOUNCE_MS = 50;
// On Unix, backslash-quote shell metacharacters (spaces, parens, etc.).
// On Windows, cmd.exe doesn't use backslash-quoting and `\` is the path
// separator, so we leave the path as-is.
const UNIX_SHELL_SPECIAL_CHARS = /[ '"()&|;<>!#$`{}[\]*?]/g;
const UNIX_SHELL_SPECIAL_CHARS = /[ \t\n\r'"()&|;<>!#$`{}[\]*?\\]/g;
/**
* Escapes special shell characters in a path segment.