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

Investigate using toggleterm.nvim for toggleable, persisted yazi sessions #137

Closed
mikavilpas opened this issue Jun 27, 2024 · 7 comments
Closed
Labels
enhancement New feature or request help wanted Extra attention is needed stale

Comments

@mikavilpas
Copy link
Owner

Currently, yazi is displayed in a floating terminal. The terminal can be opened, and after it's closed the entire yazi session is gone forever.

Although it's very fast to start a new session, this is too disruptive for the following use cases:

  1. yazi is displayed over something important, and I want to see the thing that's hidden, and then return back to the yazi session
  2. the bulk renaming feature provided by yazi cannot work because it needs to continue the yazi session (this is also tracked in Bulk renaming is broken #135)

I think it should be possible to hide yazi without closing it, and then reshow it.

@mikavilpas mikavilpas added enhancement New feature or request help wanted Extra attention is needed labels Jun 27, 2024
@mikavilpas
Copy link
Owner Author

If anyone has experience with toggleterm.nvim, I would really welcome any ideas! I haven't used it myself so I think I might be missing something obvious

https://github.com/akinsho/toggleterm.nvim?tab=readme-ov-file

@sxyazi
Copy link

sxyazi commented Jun 28, 2024

the bulk renaming feature provided by yazi cannot work because it needs to continue the yazi session

I think it's because Yazi starts with yazi --local-events > /tmp/xxx, which doesn't affect Yazi's own TUI rendering since Yazi's TUI happens in stderr. But when Yazi invokes nvim for renaming, nvim's TUI renders in stdout, which means all TUI output gets redirected to /tmp/xxx, making it invisible.

This issue would not only affect nvim but any interactive program launched within Yazi. Do you think it's feasible to abandon --local-events and make the new command ya sub work instead?

@mikavilpas
Copy link
Owner Author

That's a great idea. I think this is definitely the way we should go.

@mikavilpas
Copy link
Owner Author

Note to myself:

Displaying a long running yazi process will need #152 which provides support for ya to read events continuously instead of at the end of the yazi session as is currently done.

@mikavilpas
Copy link
Owner Author

update: ya is now used to read events. Some events are read "live", meaning that they can be handled while the floating window is open. Other events need to be handled after the floating window has closed.

An interesting example are delete events. When they are received (which means the user deleted a file in yazi, and the file was also open in a window behind the floating window), yazi.nvim should close the buffer for the file that was deleted.

In some cases it's not possible to do this. It seems if the file is the only visible window, neovim fails to delete the buffer silently. This can be tracked in neovim/neovim#20315

Copy link
Contributor

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Aug 28, 2024
Copy link
Contributor

This issue was closed because it has been inactive for 14 days since being marked as stale.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed stale
Projects
None yet
Development

No branches or pull requests

2 participants