Autosuggestion not escaping square brackets in file paths
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 65.1k
- Forks
- 5.6k
- PR merge metrics
- PR metrics pending
Description
Discord username (optional)
No response
Describe the bug
When using git to interact with a file containing square brackets somewhere in its file path, the autosuggestion is not escaping the brackets. When I subsequently tab-complete and execute the suggested command, it fails. This is particularly troublesome in Next.js apps, because the bracket notation is a built-in feature of the framework and many, many files are nested under directories with brackets in the name.
I've only noticed this issue when using git within Warp. Other file system commands don't appear to experience the same issue. I've also confirmed this is not an issue in other terminals, e.g. the macOS Terminal application.
To reproduce
Screen recording demo can be found here.
Minimal reproduction looks like this:
mkdir warp-bracket-autocomplete-demo && cd warp-bracket-autocomplete-demo
mkdir src && mkdir src/\[id\]
touch src/\[id\]/foo.txt
git add .
git reset # [tab complete]
The tab completion offers this:
Click enter to accept the suggestion:
Notably, the less command does not experience this issue:
Tab completions from there will properly escape the bracket characters and the command executes as expected.
Expected behavior
I expect the tab-completed autosuggestion to automatically escape the bracket characters:
git reset src/\[id\]/foo.txt
Screenshots
- Screen recording
- See above section for screenshots
Operating system
MacOS
Operating system and version
macOS Sonoma 14.0
Shell Version
zsh 5.9 (x86_64-apple-darwin23.0)
Current Warp version
v0.2023.12.12.08.02.stable_04
Regression
No, this bug or issue has existed throughout my experience using Warp
Recent working Warp date
No response
Additional context
I'm not certain if this is a regression or not. I can't specifically recall a previous version of Warp which would properly escape characters from autosuggestions, but I only recently began using Next.js and that's when I noticed this problem.
Does this block you from using Warp daily?
No
Is this a Warp specific issue? (i.e. does it happen in Terminal, iTerm, Kitty, etc.)
Yes, this I confirmed this only happens in Warp, not other terminals.
Warp Internal (ignore): linear-label:b8107fdf-ba31-488d-b103-d271c89cac3e
None
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no repository files or tests. Start by reproducing the commands in the issue and tracing Warp's git tab-completion/autosuggestion entry point; done means the suggested command escapes square brackets in paths, allowing it to execute successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, zsh
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100