Nushell: rm <symlink> removes target instead

Created on 14 Aug 2020  ·  5Comments  ·  Source: nushell/nushell

The following steps:

touch test
ln -s test t
rm t

cause the file test to be removed instead of the link t.

Subsequent calls to rm t produce an error:

error: No valid paths
  ┌─ shell:1:1
  │
1 │ rm t
  │ ^^ no valid paths

Running macOS 10.14, nushell 0.18.1 installed from brew.

bug good first issue upstream

Most helpful comment

Makes sense. Just glad to help, @thegedge, even if small. I really like what you all are doing here. Thanks.

All 5 comments

Hmm, I'm not experiencing this. When I run rm t, it removes the symlink, not the test file. I'm on macOS 10.15.6.

☝️ same for me, both from master and Homebrew.

@ne-on can you verify? If it's actually deleting the target instead of the symlink, can you think of any other reasons why that may be happening?

I went through the config file commenting things out.
I only seem to have the problem when rm_always_trash = true

Thanks, @ne-on . It's possible it's a bug in the crate we use to send files to the trash (https://crates.io/crates/trash). If so, we can keep this issue open until we fix it upstream and bump the version in nushell.

Makes sense. Just glad to help, @thegedge, even if small. I really like what you all are doing here. Thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cdhunt picture cdhunt  ·  4Comments

KasMA1990 picture KasMA1990  ·  4Comments

cdhunt picture cdhunt  ·  5Comments

daschl picture daschl  ·  5Comments

ghost picture ghost  ·  4Comments