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

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

Closed
Sonico98 opened this issue Apr 16, 2024 · 5 comments · Fixed by #922
Closed

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

Sonico98 opened this issue Apr 16, 2024 · 5 comments · Fixed by #922
Labels
bug Something isn't working

Comments

@Sonico98
Copy link

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

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

@Sonico98 Sonico98 added the bug Something isn't working label Apr 16, 2024
@sxyazi
Copy link
Owner

sxyazi commented Apr 16, 2024

Thanks for the report!

Should be related to ratatui/ratatui#1032, will create a PR rollback ratatui to v0.26.1

@sxyazi
Copy link
Owner

sxyazi commented Apr 16, 2024

Please try #922

@sxyazi sxyazi added the waiting on op Waiting for more information from the original poster label Apr 16, 2024
@Sonico98
Copy link
Author

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!

@github-actions github-actions bot removed the waiting on op Waiting for more information from the original poster label Apr 17, 2024
@sxyazi
Copy link
Owner

sxyazi commented Apr 17, 2024

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!

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 May 17, 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
Development

Successfully merging a pull request may close this issue.

2 participants