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

An unexpected delay occurs when opening Yazi (:Yazi) when using tmux #603

Closed
itse4elhaam opened this issue Dec 8, 2024 · 26 comments
Closed

Comments

@itse4elhaam
Copy link

image

@mikavilpas
Copy link
Owner

Hi, are you still working on this issue? I currently see a still image but was expecting maybe a video and some explanation.

@itse4elhaam
Copy link
Author

Maybe I was not able to explain it well.

Expected Behaviour:

I run :Yazi and it should open Yazi in a floating window.

What Happens:

I run :Yazi and the screen stays blank for some time and then after a minute Yazi loads. Here is a better screenshot:

image

@mikavilpas
Copy link
Owner

Are you on Windows by any chance? I'm thinking it's maybe related to your environment.

Can you try to reproduce it with a minimal configuration? That way we could learn a bit more about the issue.
https://github.com/mikavilpas/yazi.nvim/blob/main/documentation/reproducing-issues.md

For reference, here is the performance that I see in my own setup:

toggle.mov

@mikavilpas
Copy link
Owner

You could also try opening :term which opens a new terminal in neovim, and then running yazi there to see if it's also slow there. If you can, send me a video of you doing that. Maybe it's the best way to understand what it looks like 🙂

@redbeardymcgee
Copy link

When I follow these instructions, I get the same error as reported here. Takes almost 10 seconds to open a functional yazi pane. It hangs saying 0c in the pane. Then it hangs showing the following screenshot.

Screenshot

satty-2024-12-08_09:05:36

When I run yazi outside of nvim, it launches as expected in an instant. I'm not sure where to start looking for the error, except for bisecting my nvim config for a few hours. I just use oil for now and hate it.

@mikavilpas
Copy link
Owner

It looks like there is some delay in opening yazi.

  • do you get the same delay outside of neovim, in your terminal?
  • do you get this delay if you run :term in neovim, and then start yazi in that terminal?

@redbeardymcgee
Copy link

I noted that I followed your instructions to the same result, as well as running yazi in a normal terminal.

@mikavilpas
Copy link
Owner

If it's also slow when starting yazi outside of yazi.nvim in a terminal, it's most likely an issue with yazi. It might be that it needs to be addressed there.

But before opening an issue against yazi, it might be worth it to try https://github.com/sxyazi/yazi/releases/tag/v0.4.0 which was released about an hour ago. It may work better, and most likely fixing this issue should be done against the newest version anyway.

@itse4elhaam
Copy link
Author

Hey @mikavilpas Here is my configuration if you still need to try and reproduce the issue. And yes technically I am on windows but I am using WSL2 Ubuntu.

https://github.com/itse4elhaam/nvim-nvchad/tree/feat/yazi

Also, yes it does seem like an env related issue.

@itse4elhaam
Copy link
Author

@mikavilpas I think you can close this issue. The problem seems to occur when you try to open yazi in a Nvim integrated terminal.

Thanks for your support man!

@redbeardymcgee
Copy link

If it's also slow when starting yazi outside of yazi.nvim in a terminal, it's most likely an issue with yazi. It might be that it needs to be addressed there.

But before opening an issue against yazi, it might be worth it to try sxyazi/yazi@v0.4.0 (release) which was released about an hour ago. It may work better, and most likely fixing this issue should be done against the newest version anyway.

Hi, thanks for looking into this.

I'm already running 0.4.0, as I tested it for this issue and updated all my plugins.

satty-2024-12-08_09:59:33

As stated in orange, I tried running it in a :term as per your instruction and the result was a slow buggy startup.

In red, I noted that the issue does not occur outside nvim.

Hope this clears everything up.

@mikavilpas
Copy link
Owner

@redbeardymcgee instead of bisecting your config, can you try the following:

If you open yazi in the minimal reproduction setup (detailed in https://github.com/mikavilpas/yazi.nvim/blob/main/documentation/reproducing-issues.md), do you get the slow startup with yazi.nvim?

Also, do you get the slow startup in :term?

@redbeardymcgee
Copy link

redbeardymcgee commented Dec 8, 2024

@mikavilpas I'm so sorry, but can I confirm that you are able to see my comments in full? I'm worried that perhaps github is hiding them from you, or truncating them perhaps?

EDIT: reword to be clearer that i'm concerned my comments are somehow broken or missing

@redbeardymcgee
Copy link

redbeardymcgee commented Dec 8, 2024

I have confirmed the issue exists even with the minimal repro config.

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)

@chenxin-yan
Copy link
Contributor

chenxin-yan commented Dec 8, 2024

I encountered a similar issue on macOS with WezTerm inside a tmux session. I have already migrated my configuration to Yazi 4.0. Yazi works well for me outside of Neovim and inside Neovim when not in a tmux session. However, I have noticed that Yazi starts a bit slower inside of neovim after the update.

I tried to open Yazi inside of Neovim's builtin terminal. The issue persists when inside tmux session.

@redbeardymcgee
Copy link

Yazi 0.4.0 (60ed6c9 2024-12-08) fixed this issue for me. Thanks for your awesome repro config @mikavilpas, it really saved me a lot of time and complexity.

sxyazi/yazi#2015 indicates that WSL environments may still be affected, for any future readers who arrive here.

@mikavilpas mikavilpas pinned this issue Dec 9, 2024
@mikavilpas
Copy link
Owner

Awesome! I pinned this issue as I think it may be a common bug with the yazi version 0.4.0

@mikavilpas mikavilpas changed the title An unexpected delay occurs when opening Yazi (:Yazi) An unexpected delay occurs when opening Yazi (:Yazi) when using tmux Dec 9, 2024
@chenxin-yan
Copy link
Contributor

I can confirm that Yazi's latest commit fixed the issue.

@mikavilpas
Copy link
Owner

Excellent work. I'll close this issue as the cause seems to be known and a fix is available in the nightly yazi.

@sxyazi
Copy link

sxyazi commented Dec 10, 2024

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

@mikavilpas
Copy link
Owner

Very nice! Thanks again for a fast response 👍🏻

mikavilpas added a commit that referenced this issue Dec 10, 2024
It includes this important fix
- #603

For the full release notes, see
- https://github.com/sxyazi/yazi/releases/tag/v0.4.1
mikavilpas added a commit that referenced this issue Dec 10, 2024
It includes this important fix
- #603

For the full release notes, see
- https://github.com/sxyazi/yazi/releases/tag/v0.4.1
@kohane27
Copy link

kohane27 commented Dec 15, 2024

Thanks guys! I had this exact problem after updating to v0.4.0. After updating to v0.4.2 fixed this issue. Appreciate all the help and quick response!

@juanibiapina
Copy link

juanibiapina commented Dec 28, 2024

I have it in yazi 0.4.2, but only when using this plugin and my config. it works normally with :terminal yazi and using repro.lua.

@mikavilpas
Copy link
Owner

@juanibiapina try to pin down where it happens. You can try disabling half of your plugins/config and retrying until you find the cause, for example (binary search)

@juanibiapina
Copy link

juanibiapina commented Dec 28, 2024

It happens with vim-projectionist plus:

let g:projectionist_heuristics = {
      \  "*" : {
      \  },
      \}

😱

@mikavilpas
Copy link
Owner

Interesting! Could you open a new issue for this? I can take a look at it in the coming days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants