zsh-workers
 help / color / mirror / code / Atom feed
* When $PWD contains colon, completions for Makefile become broken.
@ 2024-07-17 12:42 fp oop
  0 siblings, 0 replies; only message in thread
From: fp oop @ 2024-07-17 12:42 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 1144 bytes --]

I found zsh suddenly cannot complete targets of Makefile at current $PWD,
so I digged into the source code

https://sourceforge.net/p/zsh/code/ci/master/tree/Completion/Unix/Command/_make

And found this line:
```

basedir=${(j./.)${${~"${(@s.:.):-$PWD:${(Q)${opt_args[-C]:-$opt_args[--directory]}//\\:/$nul}}"}[(R)/*,cdir]}//$nul/:}
  # I added the following two lines for debugging
  echo "[DEBUG] PWD == $PWD"
  echo "[DEBUG] basedir == $basedir"
```

 I added the two `echo` for debugging, and it outputs:

```
[DEBUG] PWD == /home/user/workspace/_obs/home:username/packagename
[DEBUG] basedir == /home/user/workspace/_obs/home/username/packagename/
```

The reason seems to be that the $PWD contains a colon (`:`). However, in
Open Build Service (a service provided by openSUSE), its CLI command `osc`
always creates lots of folders whose name containing colons in localhost
(it's the naming rule of Open Build Service).

I also tried to look into this line for a fix, but I found I don't sure why
it processed PWD in such way on purpose, so I think I should report a bug
to the original developers first instead of making a patch for it.

[-- Attachment #2: Type: text/html, Size: 2115 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-07-17 12:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-17 12:42 When $PWD contains colon, completions for Makefile become broken fp oop

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).