sxyazi / yazi

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

`cwd` gets messed up when using `g<Space>` with `../` #1416

Closed TobisLee closed 1 month ago

TobisLee commented 1 month ago

What system are you running Yazi on?

Linux Wayland

What terminal are you running Yazi in?

kitty 0.35.2

yazi --debug output

```sh ##### ↓↓↓ Paste the output here: ↓↓↓ ##### Yazi Version: 0.3.0 (d2ebadb6 2024-08-03) Debug : false OS : linux-x86_64 (unix) Ya Version: 0.3.0 Emulator Emulator.via_env: ("xterm-kitty", "") Emulator.via_csi: Ok(Kitty) Emulator.detect : Kitty Adapter Adapter.matches: Kitty Desktop XDG_SESSION_TYPE: Some("wayland") WAYLAND_DISPLAY : Some("wayland-0") DISPLAY : Some(":0") SSH shared.in_ssh_connection: false WSL /proc/sys/fs/binfmt_misc/WSLInterop: false Variables SHELL : Some("/usr/bin/fish") EDITOR : Some("nvim") YAZI_FILE_ONE : None YAZI_CONFIG_HOME : None ZELLIJ_SESSION_NAME: 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: 3.4 Dependencies file : 5.45 ueberzugpp : 2.9.6 ffmpegthumbnailer: 2.2.2 magick : 7.1.1-36 fzf : 0.54.3 fd : 10.1.0 rg : 14.1.0 chafa : 1.14.1 zoxide : 0.9.4 7z : 17.05 7zz : No such file or directory (os error 2) jq : 1.7.1 -------------------------------------------------- When reporting a bug, please also upload the `yazi.log` log file - only upload the most recent content by time. You can find it in the "/home/tlss/.local/state/yazi" directory. ```

Did you try the latest nightly build to see if the problem got fixed?

Yes, and I updated the debug information above (yazi --debug) to the nightly that I tried

Describe the bug

When using g<Space> with ../xxx/xxx, the cwd in the header is appended directly.

screenshot_20240806_010056

screenshot_20240806_010858

Minimal reproducer

  1. Open yazi
  2. Press g<Space>
  3. Input ../ then press <Enter>
  4. Check the cwd in the header

Anything else?

No response

TobisLee commented 1 month ago

I noticed that when we use g<Space>, the new URL is generated by concatenating the current cwd and the user input

https://github.com/sxyazi/yazi/blob/f8659104814f183a1f580bd30cb481136105bf94/yazi-shared/src/fs/path.rs#L46

This action does not seem to resolve the relative path correctly. I will open a PR to fix that.

github-actions[bot] commented 1 week 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.