sxyazi / yazi

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

Crash: byte index 19 is not a char boundary #921

Closed Sonico98 closed 5 months ago

Sonico98 commented 5 months ago

What system are you running Yazi on?

Linux Wayland

What terminal are you running Yazi in?

kitty 0.33.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.4 (9e75ed5 2024-04-16) OS: linux-x86_64 (unix) Debug: false Emulator Emulator.via_env: ("xterm-kitty", "") Emulator.via_csi: Ok(Kitty) Emulator.detect: Kitty Adaptor Adaptor.matches: Kitty Desktop XDG_SESSION_TYPE: Some("wayland") WAYLAND_DISPLAY: Some("wayland-1") DISPLAY: Some(":0") 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 file(1) Version: Ok(Output { status: ExitStatus(unix_wait_status(0)), stdout: "file-5.45\nmagic file from /usr/share/file/misc/magic\nseccomp support included\n", stderr: "" }) Text Opener default: Some(Opener { run: "~/.dotfiles/scripts/yazi/kitty_cmds.sh -v \"$@\"", block: false, orphan: true, desc: "Open in nvim", for_: None, spread: true }) block: Some(Opener { run: "$EDITOR \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true }) tmux TMUX: false Ueberzug++ Version: Ok(Output { status: ExitStatus(unix_wait_status(0)), stdout: "ueberzugpp 2.9.4\n", stderr: "" }) -------------------------------------------------- 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/sonico/.local/state/yazi" directory. ``` yazi.log is empty.

Describe the bug

After commit 9e75ed5, Yazi crashes when browsing directories where a file named Hatsuki Yura (葉月ゆら) is present. I'm sorry, I haven't been able to find some other example that causes a crash.

> RUST_BACKTRACE=full yazi

Backtrace (most recent call first):
  File "<unknown>", line 0, in __libc_start_main

The application panicked (crashed).
  byte index 19 is not a char boundary; it is inside '月' (bytes 17..20) of `Hatsuki Yura (葉月ゆら)`
in /build/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ratatui-0.26.2/src/text/line.rs, line 477
thread: main

Expected Behavior

To not crash ^^'

To Reproduce

Create a directory with the name: Hatsuki Yura (葉月ゆら), then try to navigate into any directory in the same folder.

Configuration

no config

Anything else?

No response

sxyazi commented 5 months ago

Thanks for the report!

Should be related to https://github.com/ratatui-org/ratatui/issues/1032, will create a PR rollback ratatui to v0.26.1

sxyazi commented 5 months ago

Please try https://github.com/sxyazi/yazi/pull/922

Sonico98 commented 5 months ago

Sorry for the late response, for some reason cargo insisted on using ratatui 0.26.2... even if I deleted the lock file. Had to modify the lock file manually. With ratatui v0.26.1 everything works fine. Thanks!

sxyazi commented 5 months ago

It seems like Cargo always tries the latest version, I've created a new commit to add the = qualifier for the version, it should force Cargo to use v0.26.1.

Let me merge it now, thanks for the test!

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