sxyazi / yazi

💥 Blazing fast terminal file manager written in Rust, based on async I/O.
https://yazi-rs.github.io
MIT License
15.07k stars 341 forks source link

No sensitivity to the case when renaming files in editor #1171

Closed mskvsk closed 3 months ago

mskvsk commented 3 months ago

What system are you running Yazi on?

macOS

What terminal are you running Yazi in?

kitty 0.34.1

Did you try the latest code to see if this problem got fixed?

Tried, but the problem still

yazi --debug output

```sh Yazi Version: 0.2.5 (VERGEN_IDEMPOTENT_OUTPUT 2024-06-19) Debug : false OS : macos-aarch64 (unix) Ya Version: No such file or directory (os error 2) Emulator Emulator.via_env: ("xterm-kitty", "") Emulator.via_csi: Ok(Kitty) Emulator.detect : Kitty Adapter Adapter.matches: Kitty Desktop XDG_SESSION_TYPE: None WAYLAND_DISPLAY : None DISPLAY : None SSH shared.in_ssh_connection: false WSL /proc/sys/fs/binfmt_misc/WSLInterop: false Variables SHELL : Some("/bin/zsh") EDITOR : Some("nvim") ZELLIJ_SESSION_NAME: None YAZI_FILE_ONE : None YAZI_CONFIG_HOME : None Text Opener default: Some(Opener { run: "${EDITOR:=vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true }) block : Some(Opener { run: "${EDITOR:=vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true }) tmux TMUX : false Version: No such file or directory (os error 2) Dependencies file : 5.41 ueberzugpp : No such file or directory (os error 2) ffmpegthumbnailer: 2.2.2 magick : No such file or directory (os error 2) fzf : 0.52.1 fd : 10.1.0 rg : 14.1.0 chafa : No such file or directory (os error 2) zoxide : No such file or directory (os error 2) unar : 1.10.7 jq : No such file or directory (os error 2) ```

Describe the bug

When renaming a file or files in an editor and changing just the case of some characters, Yazi acts as if it isn't sensitive to the case. So if trying to change a.txt to A.txt it produces the following error: Failed to rename: a.txt -> A.txt: Destination already exists

Expected Behavior

When renaming a.txt to A.txt or A.txt to a.txt the operation should be done.

To Reproduce

  1. Create a.txt

  2. Select it and start rename command

  3. Change the case of any character or characters, eg. A.txt

  4. Save and exit

  5. Confirm renaming: a.txt -> A.txt Continue to rename? (y/N): y

  6. Get the error: Failed to rename: a.txt -> A.txt: Destination already exists

Configuration

no config

Anything else?

Also, as a related bug or a feature:

When renaming a file in Yazi (not in an editor) and doing the same - trying to change the case of any character(s) in the filename - it asks if an exiting file needs to be overwritten which is weird. As if it isn't sensitive to the cast at all and thinks that I am trying to rename to the same name instead of completely different name which should be the cast on Unix-based OS.

5-pebbles commented 3 months ago

I can't reproduce this; I might be misunderstanding the problem, but everything seems to work fine on Fedora Linux.

Xerxes-2 commented 3 months ago

I can't reproduce this; I might be misunderstanding the problem, but everything seems to work fine on Fedora Linux.

Because Linux is by default case-sensitive. You should be able to reproduce it in macOS or Windows. I'm currently working on this issue and have fixed the bulk_rename_do function. The rename_do one is a bit tricky and may need some more time looking into it.

sxyazi commented 3 months ago

Should be fixed in https://github.com/sxyazi/yazi/pull/1185 by @Xerxes-2, please give it a try!

mskvsk commented 3 months ago

Thank you @sxyazi and @Xerxes-2, the issue is completely fixed!

github-actions[bot] commented 2 months ago

I'm going to lock this issue because it has been closed for 30 days. ⏳ This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.