git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git-completion.zsh does not escape spaces in filenames

From
SBSebastian Boehm <sebastian@sometimesfood.org>
Date
Aug 31, 2016, 14:31 UTC
Message-ID
<CAH4qiVc-KZCjcnxfxicO85ocjFhpXpobfZLvcVniLkz5EJoW4A@mail.gmail.com>
Hi,
git-completion.zsh does not seem to properly escape spaces in filenames.

My git version: 2.9.2 My zsh version: 5.0.8

Expected behaviour: When completing filenames that contain spaces, for example "foo bar", I would expect the git completion to complete "git add foo<TAB>" to "git add foo\ bar".

Actual behaviour:

touch "foo bar" git add foo<TAB>

results in: git add foo bar

I am not a zsh expert, but apparently the usage of "compadd -Q" in contrib/complete/git-completion.zsh prevents zsh from escaping spaces.

Is this behaviour intentional, or is this a bug?

Best, Sebastian

Message 1 of 1 in “git-completion.zsh does not escape spaces in filenames”
  1. Sebastian BoehmAug 31, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.