nnn: Can't get preview to work

Environment details (Put x in the checkbox along with the information)

[x] Operating System: MacOS 10.14.6 [ ] Desktop Environment: [x] Terminal Emulator: iTerm2 [x] Shell: zsh [ ] Custom desktop opener (if applicable): [ ] Program options used: [ ] Configuration options set: [x] Issue exists on nnn master

NNN_PLUG=f:fzcd;o:fzopen;z:fzz;d:diffs;t:treeview;v:preview-tui
NNN_FIFO=/tmp/nnn.fifo
TMUX v3.1b
nnn v3.2

Maybe I’m just dumb, but I can’t get the preview to work.

  1. I hover on file
  2. Press ;
  3. Press v
  4. nnn just flickered but nothing show… what did I miss? 🤔

Please help. Thank you

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 45 (27 by maintainers)

Most upvoted comments

@leovilok I made it future version proof to version 9. See commit 56eea7e195e98eedca374cfc24cc43afe73d43db. By the time tmux reaches v9 we can remove the check. 😉

Nice. I tried to make a .svg out of it so you could embed the animation in the readme (it’s not obvious that there is an animation if you click on it), but so far it’s not working.

I’ll post an update here with the file when/if I succeed.

Thanks all for your help. All issues fixed, so here is a clean cast for the wiki or the plugin page: https://asciinema.org/a/336443

The performance of nnn is really phenomenal (remember that it’s a phone), and tree-node-cli is also much faster than the module I tried before.

@Kabouik interrupting is already implemented, just use viu "$1" & instead of viu "$1".

@Kabouik it’s a shame that you have those “Terminated …” messages, try this replacement:

-kill %- %+ 2>/dev/null
+kill %- %+ 2>/dev/null && wait %- %+ 2>/dev/null

@kuntau this might be a bit simpler, but not v4.0 proof:

if [ -e "${TMUX%%,*}" ] && tmux -V | grep -q '[ -]3\.' ; then

Excellent, thanks! For testing, I just removed the version check you quoted from preview-tui and that works. In my case it might be easier to do just that instead of changing the version tmux reports.

The problem is tmux next-3.2. The check we have currently is:

"$(tmux -V | cut -c6)" -eq 3

which fails. I also compiled tmux from source and faced this problem. You can hack the code to change the version to “3.2”. That’s what I did.