Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[Bug Report] Erroneous path resolution for `rm /*`



Hello all,

 

I am writing this email to report a bug in Zsh 5.8 that I could not find documented anywhere online. There is a feature that prompts the user for confirmation when invoking `rm` with a glob argument. The message usually reads:

```zsh

zsh: sure you want to delete all $n files in $dir [yn]?

```

Running `rm /*` triggers a prompt for the pattern `*` at the current directory rather than at root. This is misleading and could prove disastrous.

 

Steps to reproduce:

  1. Ideally, run in a VM.
  2. Make sure you have `unsetopt RM_STAR_SILENT`.
  3. Run `rm /*` from a non-root directory.

 

Expected prompt:

```zsh

zsh: sure you want to delete all $n files in / [yn]?

```

 

Actual prompt:

```zsh

zsh: sure you want to delete all $n files in $(pwd) [yn]?

```

 

Best,

Vinh-Kha

 



Messages sorted by: Reverse Date, Date, Thread, Author