Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mskvsk opened this issue Jun 19, 2024 · 5 comments · Fixed by #1185
Closed

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

mskvsk opened this issue Jun 19, 2024 · 5 comments · Fixed by #1185
Labels
bug Something isn't working

Comments

@mskvsk
Copy link
Contributor

mskvsk commented Jun 19, 2024

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

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.

@mskvsk mskvsk added the bug Something isn't working label Jun 19, 2024
@5-pebbles
Copy link

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

@Xerxes-2
Copy link
Contributor

Xerxes-2 commented Jun 22, 2024

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
Copy link
Owner

sxyazi commented Jun 23, 2024

Should be fixed in #1185 by @Xerxes-2, please give it a try!

@mskvsk
Copy link
Contributor Author

mskvsk commented Jun 24, 2024

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

Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
4 participants