yazi: BUG: code previewer skip .ass subtitle file

What system are you running Yazi on?

Linux Wayland

What terminal are you running Yazi in?

kitty 0.40.0

yazi --debug output

Yazi
    Version: 25.3.7 (1a2a18e 2025-03-21)
    Debug  : false
    Triple : x86_64-unknown-linux-gnu (linux-x86_64)
    Rustc  : 1.85.1 (4eb16125 2025-03-15)

Ya
    Version: 25.3.7 (1a2a18e 2025-03-21)

Emulator
    TERM                : Some("xterm-kitty")
    TERM_PROGRAM        : None
    TERM_PROGRAM_VERSION: None
    Brand.from_env      : Some(Kitty)
    Emulator.detect     : Emulator { kind: Left(Kitty), light: false, cell_size: Some((11, 22)) }

Adapter
    Adapter.matches    : Kgp
    Dimension.available: WindowSize { rows: 45, columns: 169, width: 1859, height: 990 }

Desktop
    XDG_SESSION_TYPE           : Some("wayland")
    WAYLAND_DISPLAY            : Some("wayland-1")
    DISPLAY                    : Some(":0")
    SWAYSOCK                   : None
    HYPRLAND_INSTANCE_SIGNATURE: Some("7ea4fbf0ba034d947339b3a94a10da022eca1988_1742698118_1219751598")
    WAYFIRE_SOCKET             : None

SSH
    shared.in_ssh_connection: false

WSL
    WSL: false

Variables
    SHELL           : Some("/usr/bin/fish")
    EDITOR          : Some("nvim")
    VISUAL          : None
    YAZI_FILE_ONE   : None
    YAZI_CONFIG_HOME: None
    YAZI_ZOXIDE_OPTS: None
    FZF_DEFAULT_OPTS: None

Text Opener
    default     : Some(OpenerRule { run: "kitty --app-id \"nvim\" -e nvim \"$@\"", block: false, orphan: true, desc: "Nvim", for_: None, spread: true })
    block-create: Some(OpenerRule { run: "exiftool \"$1\"; echo \"Press enter to exit\"; read _", block: true, orphan: false, desc: "Show EXIF", for_: None, spread: false })
    block-rename: Some(OpenerRule { run: "exiftool \"$1\"; echo \"Press enter to exit\"; read _", block: true, orphan: false, desc: "Show EXIF", for_: None, spread: false })

Multiplexers
    TMUX               : false
    tmux version       : No such file or directory (os error 2)
    tmux build flags   : enable-sixel=Unknown
    ZELLIJ_SESSION_NAME: None
    Zellij version     : No such file or directory (os error 2)

Dependencies
    file          : 5.46
    ueberzugpp    : 2.9.6
    ffmpeg/ffprobe: 7.1 / 7.1
    pdftoppm      : 25.03.0
    magick        : 7.1.1-46
    fzf           : 0.60.3
    fd/fdfind     : 10.2.0 / No such file or directory (os error 2)
    rg            : 14.1.1
    chafa         : 1.14.5
    zoxide        : 0.9.7
    7zz/7z        : No such file or directory (os error 2) / 24.09
    jq            : 1.7.1

Clipboard
    wl-copy/paste: 2.2.1 / 2.2.1
    xclip        : No such file or directory (os error 2)
    xsel         : No such file or directory (os error 2)


See https://yazi-rs.github.io/docs/plugins/overview#debugging on how to enable logging or debug runtime errors.

Describe the bug

Code previewer will skip .ass subtitle file, the first time I hover over it (after code previewer load). See the video below.

Minimal reproducer

Prerequisite: An .ass file in the end of $HOME

Step 1: Open Yazi Step 2: Press k to cycle to the last file (.ass file) Step 3: Bug happens.

Anything else?

In this video, I only pressed k (arrow prev) 1 time to hover over Aparida - 10.ass file, but then yazi think I pressed twice. Tried to run yazi with clean config, but it still happens. https://github.com/user-attachments/assets/d5cae436-d52b-43e0-87f3-f8e1d938a7c9

Here is the test file, please change file extension to .ass as GitHub doesn’t allow uploading an .ass file, actually I even after renamed it to .txt this bug still happens. I guess it’s something related to file encoding or overflow?: Aparida - 10.txt

Edit: Just notice, this only happens if the yazi open in new workplace, where there isn’t any other window.

Checklist

  • I tried the latest nightly build, and the issue is still reproducible
  • I updated the debug information (yazi --debug) input box to the nightly that I tried
  • I can reproduce it after disabling all custom configs/plugins (mv ~/.config/yazi ~/.config/yazi-backup)

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 18 (16 by maintainers)

Most upvoted comments

Closing for now then, please reopen or create a new issue if there’s any updates that need to be fixed on Yazi’s side

From the logs, Yazi received two k key press events, which is the reason why Yazi moved up from the ass file:

  2025-03-23T15:30:23.174752Z DEBUG yazi::app::app: 💥dispatch: Key(KeyEvent { code: Char('k'), modifiers: KeyModifiers(0x0), kind: Press, state: KeyEventState(0x0) })
  2025-03-23T15:30:23.802015Z DEBUG yazi::app::app: 💥dispatch: Key(KeyEvent { code: Char('k'), modifiers: KeyModifiers(0x0), kind: Press, state: KeyEventState(0x0) })
  2025-03-23T15:30:24.327707Z DEBUG yazi::app::app: 💥dispatch: Key(KeyEvent { code: Char('q'), modifiers: KeyModifiers(0x0), kind: Press, state: KeyEventState(0x0) })

My best guess is that some content in the ass file somehow triggered a bug in kitty that led to repeated key reports, even though I’m not able to reproduce it on my kitty.

Some debugging at the terminal level is required to see what is actually happening, as I am not sure how to debug kitty, I suggest reporting this to the kitty developers for support.

Apply this patch and upload the logs when it reoccurs:

--- a/yazi-fm/src/app/app.rs
+++ b/yazi-fm/src/app/app.rs
@@ -52,6 +52,7 @@ impl App {

        #[inline]
        fn dispatch(&mut self, event: Event) -> Result<()> {
+               tracing::debug!("💥dispatch: {:?}", event);
                match event {
                        Event::Call(cmd) => self.dispatch_call(cmd),
                        Event::Seq(cmds) => self.dispatch_seq(cmds),

not every .ass file, just some files I downloaded from subsource, has this issue

Is it related to the file content or the file name? Try changing the content to see if there is any change. If there is, bisect it to find the minimal reproducible content.