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

preview-tui: add QuickLook support for WSL #960

Merged
merged 1 commit into from
Apr 22, 2021
Merged

preview-tui: add QuickLook support for WSL #960

merged 1 commit into from
Apr 22, 2021

Conversation

luukvbaal
Copy link
Collaborator

Add QuickLook support for WSL as suggested in #959.

Perhaps this should be a separate plugin since essentially bypasses all logic provided by preview-tui but on the other hand having all previewers in a single script has merit.

@jtourlamain
Copy link

@luukvbaal wow that was quick! When launching the preview, nnn returns to the command prompt but the preview windows opens. When hitting CTRL-C I return to nnn and the preview window functions as desired. Is there a way to disable the preview again, because if I close the preview window and select another file, the preview reopens.

@luukvbaal
Copy link
Collaborator Author

When not running in tmux QuickLook will be used to preview everything. I also added QuickLook as an additional option for preview_image so preview-tui(-ext) will now use QuickLook to preview images when running in tmux.

@jtourlamain not sure how to address the fact that you can't disable previews for the pure QuickLook preview mode. When running inside tmux, closing the preview pane will also stop QuickLook previews.

@luukvbaal
Copy link
Collaborator Author

As far as I'm concerned this can be merged.

The QuickLook and $TERMINAL preview modes could use a solution to kill the preview process when pressing ^C in nnn but I couldn't find a reliable way to do that in the script. We need a way to kill all child processes from a trap in the main plugin shell while not blocking nnn input but I couldn't figure it out.

@jtourlamain
Copy link

ok great thx

@jarun jarun merged commit f0c64a8 into jarun:master Apr 22, 2021
@jarun
Copy link
Owner

jarun commented Apr 22, 2021

Thank you!

@luukvbaal luukvbaal deleted the quicklook branch April 22, 2021 15:52
@luukvbaal
Copy link
Collaborator Author

Is there a way to disable the preview again, because if I close the preview window and select another file, the preview reopens.

@jtourlamain #961 allows you to do this by pressing the plugin key a second time.

@jtourlamain
Copy link

jtourlamain commented Apr 22, 2021

your implementation works like magic! I can start the previewer and stop it with the same command 👍
I can now use the Windows Terminal open up WSL2 browse my files with nnn and preview them with QuickLook.... nice!

@github-actions github-actions bot locked and limited conversation to collaborators May 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants