-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Generator-produced suggestions are not shell-escaped before insertion #11072
Copy link
Copy link
Open
Labels
area:completionsStandard shell completions, argument completions, and path completion.Standard shell completions, argument completions, and path completion.bugSomething isn't working.Something isn't working.os:linuxLinux-specific behavior, regressions, or requests.Linux-specific behavior, regressions, or requests.repro:highThe report includes enough evidence that the issue appears highly reproducible.The report includes enough evidence that the issue appears highly reproducible.triagedIssue has received an initial automated triage pass.Issue has received an initial automated triage pass.
Metadata
Metadata
Assignees
Labels
area:completionsStandard shell completions, argument completions, and path completion.Standard shell completions, argument completions, and path completion.bugSomething isn't working.Something isn't working.os:linuxLinux-specific behavior, regressions, or requests.Linux-specific behavior, regressions, or requests.repro:highThe report includes enough evidence that the issue appears highly reproducible.The report includes enough evidence that the issue appears highly reproducible.triagedIssue has received an initial automated triage pass.Issue has received an initial automated triage pass.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Pre-submit Checks
Describe the bug
Related: warpdotdev/command-signatures#271. That fix corrects how
git add <tab>collects filenames containing spaces in the command-signatures repo. Once it lands and the warp pin is bumped, this warp-side bug becomes user-visible: the popup shows the correct filename, but selecting it inserts an unescaped string into the buffer that the shell parses as multiple tokens.Suggestions produced by a Rust generator (
Generator::scriptregistered through the command-signatures crate) are converted to the in-appSuggestiontype via twoFromimplementations that copy the generator'sexact_stringstraight intoreplacementwith no shell-escaping. As a result, any suggestion whose value contains shell metacharacters (spaces,$,*,\, quotes, etc.) is inserted into the input buffer in a form the shell will mis-tokenize.The fix in command-signatures#272 is necessary but not sufficient: it makes generators return the correct filenames; this issue is about warp making sure those filenames are inserted in a form the shell will accept.
To reproduce
Requires command-signatures#272 (or any local pin where
files_for_staging's post-processor returns the raw filename) — without it, the bug is masked by the upstream truncation. With the upstream fix in place:In Warp:
git addand press Tab.new file test.csv(no truncation, no leading quote). Note: without command-signatures#272 this will show"newincorrectly, which is what command-signatures#272 fixes.git add new file test.csv— three space-separated tokens.git addreports that none ofnew,file,test.csvare valid pathspecs.Expected behavior
After step 3, the buffer should contain a form the shell parses as the single argument
new file test.csv— for POSIX shells, e.g.git add new\ file\ test.csvorgit add "new file test.csv". The path completer (engine/path.rs:347) already does this for filesystem-backed completions; generator-backed completions should match.Screenshots, videos, and logs
Operating system (OS)
Linux
Operating system and version
Mint 22.2
Shell Version
zsh 5.9 (x86_64-ubuntu-linux-gnu)
Current Warp version
v0.2026.05.13.09.15.stable_01
Regression
No, this bug or issue has existed throughout my experience using Warp
Recent working Warp date
No response
Additional context
Does this block you from using Warp daily?
No
Is this an issue only in Warp?
Yes, I confirmed that this only happens in Warp, not other terminals.
Warp Internal (ignore): linear-label:b9d78064-c89e-4973-b153-5178a31ee54e
None