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

Yazi has a delay while opening inside a Neovim Integrated terminal #2013

Closed
3 tasks done
itse4elhaam opened this issue Dec 8, 2024 · 10 comments · Fixed by #2014
Closed
3 tasks done

Yazi has a delay while opening inside a Neovim Integrated terminal #2013

itse4elhaam opened this issue Dec 8, 2024 · 10 comments · Fixed by #2014
Labels
bug Something isn't working waiting on op Waiting for more information from the original poster

Comments

@itse4elhaam
Copy link

itse4elhaam commented Dec 8, 2024

What system are you running Yazi on?

Windows WSL

What terminal are you running Yazi in?

Windows Terminal

yazi --debug output

Yazi
    Version: 0.4.0 (b8b3ab9b 2024-12-08)
    Debug  : false
    Triple : x86_64-unknown-linux-gnu (linux-x86_64)
    Rustc  : 1.83.0 (90b35a62 2024-11-26)

Ya
    Version: 0.4.0 (b8b3ab9b 2024-12-08)

Emulator
    Brand.from_env      : None
    Emulator.detect     : Emulator { kind: Right(Unknown { kgp: false, sixel: false }), light: false, cell_size: Some((16, 32)) }
    Emulator.detect_full: Ok(Emulator { kind: Right(Unknown { kgp: false, sixel: false }), light: false, cell_size: Some((16, 32)) })

Adapter
    Adapter.matches: Chafa

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

SSH
    shared.in_ssh_connection: false

WSL
    WSL: true

Variables
    SHELL           : Some("/usr/bin/zsh")
    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(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })
    block-create: Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })
    block-rename: Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })

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

Dependencies
    file          : 5.41
    ueberzugpp    : No such file or directory (os error 2)
    ffmpeg/ffprobe: No such file or directory (os error 2) / No such file or directory (os error 2)
    pdftoppm      : No such file or directory (os error 2)
    magick        : No such file or directory (os error 2)
    fzf           : 0.52.1
    fd/fdfind     : No such file or directory (os error 2) / 8.3.1
    rg            : 13.0.0
    chafa         : No such file or directory (os error 2)
    zoxide        : 0.9.4
    7z/7zz        : No such file or directory (os error 2) / No such file or directory (os error 2)
    jq            : 1.6

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

Describe the bug

The issue originally happened while using yazi.nvim but after some investigation it is concluded that it happens when Yazi is opened inside a Neovim integrated terminal.

image

Here is the issue at yazi.nvim for reference.

Minimal reproducer

Open yazi inside a Neovim integrated terminal. You can use this configuration, clone and open Neovim and press Alt i to open the floating terminal, now run the command Yazi. Alternatively you can also the cmd :Yazi to reproduce it.

Anything else?

I have really like the user experience of this plugin and really appreciate the effort you guys are putting in. Loads of thanks!

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)
@itse4elhaam itse4elhaam added the bug Something isn't working label Dec 8, 2024
@sxyazi
Copy link
Owner

sxyazi commented Dec 8, 2024

Can you upload the logs please when it happens again? https://yazi-rs.github.io/docs/plugins/overview#logging

@sxyazi sxyazi added the waiting on op Waiting for more information from the original poster label Dec 8, 2024
@redbeardymcgee
Copy link

redbeardymcgee commented Dec 8, 2024

Here are the logs from the minimal repro config provided in these instructions.

Log
[2024-12-08 10:32:29] DEBUG YaziFloatingWindow opening (content_buffer: 3, win: 1002)
[2024-12-08 10:32:29] DEBUG Opening yazi with the command: (yazi '/home/rbm' --chooser-file /tmp/nvim.rbm/lNseAK/0 --client-id 877848368349440).
[2024-12-08 10:32:29] DEBUG Opening ya with the command: (ya sub rename,delete,trash,move,cd,hover,bulk), attempt 0
[2024-12-08 10:32:50] DEBUG ya stdout: 'cd,0,877848368349440,{"tab":1,"url":"/home/rbm"}
'
[2024-12-08 10:32:50] DEBUG Parsed events: { {
    id = "877848368349440",
    timestamp = "0",
    type = "cd",
    url = "/home/rbm"
  } }
[2024-12-08 10:32:50] DEBUG Changing the cwd from nil to /home/rbm
[2024-12-08 10:32:50] DEBUG ya stdout: 'hover,0,877848368349440,{"tab":1,"url":null}
'
[2024-12-08 10:32:50] DEBUG Parsed events: { {
    type = "hover",
    url = "",
    yazi_id = "877848368349440"
  } }
[2024-12-08 10:32:50] DEBUG Changing the last hovered_url to 
[2024-12-08 10:32:50] DEBUG Calculating the highlights for 0 buffers
[2024-12-08 10:32:50] DEBUG { "emitting", "YaziDDSHover", {
    type = "hover",
    url = "",
    yazi_id = "877848368349440"
  } }
[2024-12-08 10:32:50] DEBUG ya stdout: 'hover,0,877848368349440,{"tab":1,"url":"/home/rbm/Desktop"}
'
[2024-12-08 10:32:50] DEBUG Parsed events: { {
    type = "hover",
    url = "/home/rbm/Desktop",
    yazi_id = "877848368349440"
  } }
[2024-12-08 10:32:50] DEBUG Changing the last hovered_url to /home/rbm/Desktop
[2024-12-08 10:32:50] DEBUG Calculating the highlights for 0 buffers
[2024-12-08 10:32:50] DEBUG { "emitting", "YaziDDSHover", {
    type = "hover",
    url = "/home/rbm/Desktop",
    yazi_id = "877848368349440"
  } }
[2024-12-08 10:33:17] DEBUG Killing ya process
[2024-12-08 10:33:17] DEBUG Waiting for ya process to exit
[2024-12-08 10:33:17] DEBUG ya stdout: ''
[2024-12-08 10:33:17] DEBUG Parsed events: {}
[2024-12-08 10:33:17] DEBUG yazi process exited successfully with code: 0, selected_files {}, and events {}
[2024-12-08 10:33:17] DEBUG Resolved the last_directory to /home/rbm
[2024-12-08 10:33:17] DEBUG YaziFloatingWindow closing (content_buffer: 3, win: 1002)

I'm not sure if these are helpful.

@sxyazi
Copy link
Owner

sxyazi commented Dec 8, 2024

No, I mean Yazi own logs, not yazi.nvim's, https://yazi-rs.github.io/docs/plugins/overview#logging

@redbeardymcgee
Copy link

I should have mentioned that I was working on that as well. Please hold.

@redbeardymcgee
Copy link

redbeardymcgee commented Dec 8, 2024

I apologize. When reproducing within neovim, yazi does not log to the file in your instructions. I only get logs from .repro/local/state/yazi/yazi.log.

Log
  2024-12-08T16:58:02.004059Z ERROR yazi_adapter::emulator: read_until_da1 timed out: [27, 93, 49, 49, 59, 114, 103, 98, 58, 48, 48, 48, 48, 47, 48, 48, 48, 48, 47, 48, 48, 48, 48, 7], error: Elapsed(())
    at yazi-adapter/src/emulator.rs:126

  2024-12-08T16:58:02.004087Z DEBUG yazi_adapter::emulator: Detected background color: 0000/0000/0000 (luma = 0.00)
    at yazi-adapter/src/emulator.rs:172

  2024-12-08T16:58:02.014112Z  WARN yazi_adapter::drivers::ueberzug: Failed to start ueberzugpp: No such file or directory (os error 2)
    at yazi-adapter/src/drivers/ueberzug.rs:94

  2024-12-08T16:58:12.017308Z ERROR yazi_adapter::emulator: read_until_da1 timed out: [], error: Elapsed(())
    at yazi-adapter/src/emulator.rs:126

@sxyazi
Copy link
Owner

sxyazi commented Dec 8, 2024

@redbeardymcgee You and the OP are in the same environment right? Windows system, running the latest Yazi 0.4 with Windows WSL in MS Terminal in tmux in Neovim's terminal. Can you upload your yazi --debug info please?

@redbeardymcgee
Copy link

No, sorry. I just followed this issue from the original thread in the yazi.nvim repo. My environment is NixOS 24.11/kitty 0.36.4/tmux 3.4/neovim 0.10.2/yazi 0.4.0

Details
Yazi
    Version: 0.4.0 (b8b3ab9 2024-12-08)
    Debug  : false
    Triple : x86_64-unknown-linux-gnu (linux-x86_64)
    Rustc  : 1.82.0 (f6e511ee 2024-10-15)

Ya
    Version: 0.4.0 (b8b3ab9 2024-12-08)

Emulator
    Brand.from_env      : Some(Kitty)
    Emulator.detect     : Emulator { kind: Left(Kitty), light: false, cell_size: Some((9, 19)) }
    Emulator.detect_full: Ok(Emulator { kind: Left(Kitty), light: false, cell_size: Some((9, 19)) })

Adapter
    Adapter.matches: Kgp

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

SSH
    shared.in_ssh_connection: false

WSL
    WSL: false

Variables
    SHELL           : Some("/run/current-system/sw/bin/bash")
    EDITOR          : Some("redvim")
    VISUAL          : Some("redvim")
    YAZI_FILE_ONE   : None
    YAZI_CONFIG_HOME: None
    YAZI_ZOXIDE_OPTS: None
    FZF_DEFAULT_OPTS: Some("--color bg:#1c1e26,bg+:#232530,fg:#9da0a2,fg+:#dcdfe4,header:#26bbd9,hl:#26bbd9,hl+:#26bbd9,info:#fac29a,marker:#59e1e3,pointer:#59e1e3,prompt:#fac29a,spinner:#59e1e3")

Text Opener
    default     : Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })
    block-create: Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })
    block-rename: Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })

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

Dependencies
    file          : 5.45
    ueberzugpp    : No such file or directory (os error 2)
    ffmpeg/ffprobe: 6.0.1 / 6.0.1
    pdftoppm      : 24.02.0
    magick        : 7.1.1-39
    fzf           : 0.55.0
    fd/fdfind     : 10.2.0 / No such file or directory (os error 2)
    rg            : 14.1.1
    chafa         : 1.14.4
    zoxide        : 0.9.6
    7z/7zz        : 17.05 / 24.08
    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)

@sxyazi
Copy link
Owner

sxyazi commented Dec 8, 2024

Please try #2014

@sxyazi
Copy link
Owner

sxyazi commented Dec 9, 2024

I resubmitted the commit 62ac224, please use this instead

@sxyazi
Copy link
Owner

sxyazi commented Dec 10, 2024

Released a new version with the fix https://github.com/sxyazi/yazi/releases/tag/v0.4.1 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working waiting on op Waiting for more information from the original poster
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants