jarun / nnn

n³ The unorthodox terminal file manager
BSD 2-Clause "Simplified" License
18.59k stars 747 forks source link

preview help #1252

Closed levone1 closed 2 years ago

levone1 commented 2 years ago

So, not to resurrect a dead horse, but I was going to just comment here - https://github.com/jarun/nnn/issues/1206 - but it's locked...

Anyway, I'm just wondering about some insight. After that issue, I had re-flashed firmware, (for a different reason), SailfishOS 4.2 on Xperia Tama (XZ2c), and re-installed Tmux and nnn, and there was no problem with preview - it worked fine, leading me to believe that there must have been some device configuration problem.

Since then, I have again re-flashed, v.4.3, and again re-installed Tmux and nnn, and now, not working, (basically clean flash, except for a few exports I've done to try to solve this).

At first, the behavior was the same as last time - just a quick blink in the terminal, but no preview. As I searched for info, I found a reddit post where someone said that Imagemagick is required for preview to work. After installing Imagemagick, now the problem is different. Now it says "no FIFO available...". (Imagemagick is not listed as a dependency, but maybe it's just automatically installed on most systems, or...?)

I start nnn with "-a", and nnn.fifo.xxxx is created in /tmp, but still the same message. I have also tried starting with "NNN_FIFO=/tmp/nnn.fifo nnn", etc.

I have tried the few tips from my previous issue, but no change. I was hoping for log output according to @0xACE 's comment, (https://github.com/jarun/nnn/issues/1206#issuecomment-950253315), but cat/tee commands he posted are not giving a log, ("... NNN.FIFO.log no such file..."

I'm not expecting anyone to spend lots of time on this, just wondering about any insights/ideas, etc.

Tmux and nnn are both built and installed from latest sources via git clone.

Thanks

levone1 commented 2 years ago

Here's my env: SHELL=/bin/bash HISTCONTROL=ignoredups G_BROKEN_FILENAMES=1 QT_WAYLAND_DISABLE_WINDOWDECORATION=1 HISTSIZE=1000 HOSTNAME= AG_SERVICE_TYPES=/usr/share/accounts/service- types QT_MESSAGE_PATTERN=[%{if-debug}D%{endif}%{if- info}I%{endif}%{if-warning}W%{endif}%{if-crit ical}C%{endif}%{if-fatal}F%{endif}] %{functio n}:%{line} - %{message} QT_DF_SCALEFORMAXDEV=0.37 QML_FIXED_ANIMATION_STEP=no QT_GSTREAMER_CAMERABIN_SRC=droidcamsrc PWD=/home/defaultuser LOGNAME=defaultuser QT_GSTREAMER_CAMERABIN_FLAGS=15 HOME=/home/defaultuser LANG=en_US.utf8 QT_DF_BASEDEVIATION=0.025 WAYLAND_DISPLAY=../../display/wayland-0 AG_SERVICES=/usr/share/accounts/services LIPSTICK_OPTIONS=-plugin evdevtouch:/dev/touc hscreen -plugin evdevkeyboard:keymap=/usr/sha re/qt5/keymaps/droid.qmap INVOCATION_ID=d446819cb7584cb6854a37d5a1c0f96 7 MANAGERPID=5529 QT_QPA_PLATFORM=wayland QMLSCENE_DEVICE=customcontext BOOTSTATE=USER EGL_PLATFORM=wayland MOZ_GMP_PATH=/usr/lib64/gmp-droid/0.1/ TERM=xterm-256color LAST_LOGIN_UID=100000 LESSOPEN=|/usr/bin/lesspipe.sh %s USER=defaultuser QT_DF_SCALEFORNODEV=0.6 QT_WAYLAND_FORCE_DPI=96 NOTIFY_SOCKET=/run/user/100000/systemd/notify SHLVL=2 QT_IM_MODULE=Maliit QT_OPENGL_NO_BGRA=1 XDG_RUNTIME_DIR=/run/user/100000

levone1 commented 2 years ago

env in Tmux: SHELL=/bin/bash HISTCONTROL=ignoredups TERM_PROGRAM_VERSION=next-3.4 TMUX=/tmp/tmux-100000/default,28592,0 G_BROKEN_FILENAMES=1 QT_WAYLAND_DISABLE_WINDOWDECORATION=1 HOSTNAME= HISTSIZE=1000 AG_SERVICE_TYPES=/usr/share/accounts/service- types QT_MESSAGE_PATTERN=[%{if-debug}D%{endif}%{if- info}I%{endif}%{if-warning}W%{endif}%{if-crittypes ical}C%{endif}%{if-fatal}F%{endif}] %{functioinfo}I%{endif}%{if-warning}W%{endif}%{if-criti n}:%{line} - %{message} }:%{line} - %{message} QT_DF_SCALEFORMAXDEV=0.37 QML_FIXED_ANIMATION_STEP=no QT_GSTREAMER_CAMERABIN_SRC=droidcamsrc PWD=/home/defaultuser LOGNAME=defaultuser QT_GSTREAMER_CAMERABIN_FLAGS=15 HOME=/home/defaultuser LANG=en_US.utf8 QT_DF_BASEDEVIATION=0.025 WAYLAND_DISPLAY=../../display/wayland-0 AG_SERVICES=/usr/share/accounts/services LIPSTICK_OPTIONS=-plugin evdevtouch:/dev/touc hscreen -plugin evdevkeyboard:keymap=/usr/sha re/qt5/keymaps/droid.qmap INVOCATION_ID=d446819cb7584cb6854a37d5a1c0f96 7 MANAGERPID=5529 QT_QPA_PLATFORM=wayland QMLSCENE_DEVICE=customcontext BOOTSTATE=USER EGL_PLATFORM=wayland MOZ_GMP_PATH=/usr/lib64/gmp-droid/0.1/ TERM=screen-256color LAST_LOGIN_UID=100000 LESSOPEN=|/usr/bin/lesspipe.sh %s USER=defaultuser QT_DF_SCALEFORNODEV=0.6 TMUX_PANE=%0 QT_WAYLAND_FORCE_DPI=96 NOTIFY_SOCKET=/run/user/100000/systemd/notify SHLVL=3 QT_IM_MODULE=Maliit QT_OPENGL_NO_BGRA=1 a-qt5 -A -- /usr/bin/sailfish-browser XDG_RUNTIME_DIR=/run/user/100000 sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/ EGL_DRIVER=egl_gallium PS1=[\u@\h \W]\$ QT_DF_BASE=0.5 QSG_FIXED_ANIMATION_STEP=no AG_PROVIDERS=/usr/share/accounts/providers JOURNAL_STREAM=8:70222 BROWSER=/usr/bin/invoker --type=browser,silic a-qt5 -A -- /usr/bin/sailfish-browser PATH=/home/defaultuser/.cargo/bin:/usr/local/ sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin: /bin QT_WAYLAND_COMPOSITOR_NO_THROTTLE=1 QTCONTACTS_MANAGER_OVERRIDE=org.nemomobile.co ntacts.sqlite QT_WAYLAND_RESIZE_AFTER_SWAP=1 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/ 100000/dbus/user_bus_socket QT_GSTREAMER_PLAYBIN_FLAGS=0 MAIL=/var/spool/mail/defaultuser GIO_LAUNCHED_DESKTOP_FILE_PID=9983 SESSION_TARGET=default.target QT_DF_RANGE=0.08 TERM_PROGRAM=tmux

0xACE commented 2 years ago

Judging by your env output it seems like you haven't set NNN_FIFO. Judging by your reply I don't think running my untested script is a good idea, it's not going to work unless you know what to do.

Anyhow...

git clone https://github.com/jarun/nnn.wiki.git nnn-wiki
cd nnn-wiki
grep -lr NNN_FIFO *.md

Outputs:

Live-previews.md
Usage.md

I guess Live-previews.md in our wiki is what you are looking for.

I recommend you read it or just do something along the lines of echo "export NNN_FIFO='/tmp/nnn.fifo' >> ~/.bashrc

Most of these types of questions are likely documented. If you get stuck, let us know -- Help us help you.

Best of luck to ya, and have a good evening, cheers.

levone1 commented 2 years ago

Judging by your env output it seems like you haven't set NNN_FIFO. Judging by your reply I don't think running my untested script is a good idea, it's not going to work unless you know what to do.

Anyhow...

git clone https://github.com/jarun/nnn.wiki.git nnn-wiki
cd nnn-wiki
grep -lr NNN_FIFO *.md

Outputs:

Live-previews.md
Usage.md

I guess Live-previews.md in our wiki is what you are looking for.

I recommend you read it or just do something along the lines of echo "export NNN_FIFO='/tmp/nnn.fifo' >> ~/.bashrc

Most of these types of questions are likely documented. If you get stuck, let us know -- Help us help you.

Best of luck to ya, and have a good evening, cheers.

Thank you for replying. I have set fifo, with export, and in bashrc, (it was what one of my "etc"s was referring to), and it will show up in env output, (the env output above is after I had removed all nnn entries, just to show general env, in cae there was something significant there), and the output is the same - always "...no fifo available ...".

I know I could be missing something, and I am happy to keep reading through docs, but I have read through those mds several times, and used nnn with various options and plugins and confs on a cew devices, so I'm somewhat familiar with it. That's why I'm so baffled... Where would it be looking for fifo, if it's in env, and if fifo is created in /tmp - why still the error?

luukvbaal commented 2 years ago

What is the exact error you get? The error should print the NNN_FIFO value detected by preview-tui, does this path match the FIFO that is actually created in your /tmp?

levone1 commented 2 years ago

Error is No FIFO available! ($NNN_PREVIEW='') Please read Usage in preview-tui.

If I export, e.g., export NNN_PREVIEW="/tmp/nnn.fifo.preview" , (as per your post), the error becomes No FIFO available! ($NNN_PREVIEW='/tmp/nnn.fifo.preview') Please read Usage in preview-tui.

When I open with "nnn -a" , what is created in /tmp is something like "nnn.fifo.2194", which is always what has happened, but still same error.

luukvbaal commented 2 years ago

The error should read NNN_FIFO, not NNN_PREVIEW. Please make sure you're not using a version of the script where NNN_FIFO is replaced with NNN_PREVIEW, as I think was suggested in the other issue. nnn is writing to NNN_FIFO, not NNN_PREVIEW...

levone1 commented 2 years ago

The error should read NNN_FIFO, not NNN_PREVIEW. Please make sure you're not using a version of the script where NNN_FIFO is replaced with NNN_PREVIEW, as I think was suggested in the other issue. nnn is writing to NNN_FIFO, not NNN_PREVIEW...

ok. I'm using https://raw.githubusercontent.com/jarun/nnn/master/plugins/preview-tui

I'll take a look through it.... Where to get other versions?

luukvbaal commented 2 years ago

ok. I'm using https://raw.githubusercontent.com/jarun/nnn/master/plugins/preview-tui

Judging by the error you posted, you aren't (or weren't) using that. Just make sure you are using the version you linked and check if the error is the same.

levone1 commented 2 years ago

ok. I'm using https://raw.githubusercontent.com/jarun/nnn/master/plugins/preview-tui

Judging by the error you posted, you aren't (or weren't) using that. Just make sure you are using the version you linked and check if the error is the same.

I just did again to be sure curl -L https://raw.githubusercontent.com/jarun/nnn/master/plugins/preview-tui | sed -e 's/NNN_FIFO/NNN_PREVIEW/g' > ~/.config/nnn/plugins/preview-tui And script was updated in my plugin (17.96 kb). I killed tmux, sourced bashrc, and tried again. Still same. Thanks

luukvbaal commented 2 years ago

Remove the | sed -e 's/NNN_FIFO/NNN_PREVIEW/g'...

levone1 commented 2 years ago

Remove the | sed -e 's/NNN_FIFO/NNN_PREVIEW/g'...

oops - you're right... Now I have a different preview-tui. Sorry, I copied that command from the previous issue; I thought it was downloading the other one... Ok, well that error is gone, but preview not showing. Back to the quick-flash-no-change... I'll keep poking around. Thanks for your time. If any other ideas, I'd appreciate.

luukvbaal commented 2 years ago

Make sure preview-tui is executable, otherwise I'm not sure without more information.

In the future, just run curl -Ls https://raw.githubusercontent.com/jarun/nnn/master/plugins/getplugs | sh to install the plugins, as suggested in the docs.

levone1 commented 2 years ago

ok, one more request, (if you can bear with me)... I think I was thorough and careful on my end this time, and I've troubleshooted my current preview failure to this error: 0/0cat: can't open '/tmp/nnn-preview-tui-fifo pid.10833': No such file or directory cat: can 't open '/tmp/nnn-preview-tui-pagerpid.10833' : No such file or directory

For some reason, it seems like nnn is not being allowed to write to /tmp, (or maybe is not seeing it or...?). I have tried to edit script in different ways (with my limited knowledge), e.g., "TMPDIR="/tmp"", but always the same, (so far)...

Thank you for any input.

luukvbaal commented 2 years ago

That indeed looks like the temporary files are not written in the location preview-tui is looking for them, or not at all. No idea why that would happen sorry.

levone1 commented 2 years ago

That indeed looks like the temporary files are not written in the location preview-tui is looking for them, or not at all. No idea why that would happen sorry.

I was able to eliminate the error about fifopid by creating a ffo manually, and changing the name to match. But, when I tried the same with the pagerpid, I got "permission denied". Trying it with su seemed to succeed, but the file wasn't there.

Anyway, thanks. Maybe I'll try to wipe and start over... I can get previews with Hunter, and nnn with preview works fine in my Linux lxc, but at this point I'm just too curious to give it up...

luukvbaal commented 2 years ago

So can you try setting TMPDIR to a directory that is actually writeable by your user?

There is no point in manually creating the tmpfiles with root access, preview-tui will fail to write to them.

levone1 commented 2 years ago

So can you try setting TMPDIR to a directory that is actually writeable by your user?

There is no point in manually creating the tmpfiles with root access, preview-tui will fail to write to them.

So I had a bright idea to copy my nnn from my Linux container to my SF fs, and now it works. Happy that it works, but still no satisfaction of finding out what the issue was.... The nnn I have installed in Linux is installed via apt, while the one I had on SF was built from git clone... One difference is that my Linux uses libncursesw6.0, while the SF fs is on 5.9, so had to copy/symlink...

Anyway, thank you all for your quickness to support, and bear with me...

Kabouik commented 2 years ago

Interesting that the issue occurs with nnn master and not the Debian package; is that after replacing just the nnn executable but keeping the same script version? Can you remind me if you used to have the same problem on SFOS with the (rather old) package I made for Openrepos, with the old preview-tui script shipped with it and with the updated script?

For the record, preview-tui does fail for me too with the package, but it used to work and I even have asciicasts showing it (see other issue). No idea what changed since I'm still running an old version of SFOS. I haven't investigated as much as you did though, so I cannot guarantee that this is the exact same issue.

On 2021-12-12 14:47 levone1 @.***> wrote:

So can you try setting TMPDIR to a directory that is actually writeable by your user?

There is no point in manually creating the tmpfiles with root access, preview-tui will fail to write to them.

So I had a bright idea to copy my nnn from my Linux container to my SF fs, and now it works. Happy that it works, but still no satisfaction of finding out what the issue was.... The nnn I have installed in Linux is installed via apt, while the one I had on SF was built from git clone... One difference is that my Linux uses libncursesw6.0, while the SF fs is on 5.9, so had to copy/symlink...

Anyway, thank you all for your quickness to support, and bear with me...

--
You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jarun/nnn/issues/1252#issuecomment-991901652

levone1 commented 2 years ago

Interesting that the issue occurs with nnn master and not the Debian package; is that after replacing just the nnn executable but keeping the same script version? Can you remind me if you used to have the same problem on SFOS with the (rather old) package I made for Openrepos, with the old preview-tui script shipped with it and with the updated script? For the record, preview-tui does fail for me too with the package, but it used to work and I even have asciicasts showing it (see other issue). No idea what changed since I'm still running an old version of SFOS. I haven't investigated as much as you did though, so I cannot guarantee that this is the exact same issue. On 2021-12-12 14:47 levone1 @.***> wrote: > So can you try setting TMPDIR to a directory that is actually > writeable by your user? > > There is no point in manually creating the tmpfiles with root > access, preview-tui will fail to write to them. So I had a bright idea to copy my nnn from my Linux container to my SF fs, and now it works. Happy that it works, but still no satisfaction of finding out what the issue was.... The nnn I have installed in Linux is installed via apt, while the one I had on SF was built from git clone... One difference is that my Linux uses libncursesw6.0, while the SF fs is on 5.9, so had to copy/symlink... Anyway, thank you all for your quickness to support, and bear with me... -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: #1252 (comment)

I just re-ran getplugs sh right away, since I couldn't remember for sure if my script was modified... I don't know if I actually used yours, since I'm on aarch64, and I don't think your source was available, so I just built from source. I think the first time I had the problem was because of the lack of tput command, which I'm now realizing may have been the issues this time, too, (but I forgot about it). I don't remember what I did to fix it then, but I'm pretty sure it had to do with ncurses also... Maybe the default Jolla ncursesw doesn't include tput, or...?

Kabouik commented 2 years ago

Right the package is not available in aarch64 as far as I remember, I thought you were on another architecture.

On 2021-12-12 15:41 levone1 @.***> wrote:

Interesting that the issue occurs with nnn master and not the Debian package; is that after replacing just the nnn executable but keeping the same script version? Can you remind me if you used to have the same problem on SFOS with the (rather old) package I made for Openrepos, with the old preview-tui script shipped with it and with the updated script? For the record, preview-tui does fail for me too with the package, but it used to work and I even have asciicasts showing it (see other issue). No idea what changed since I'm still running an old version of SFOS. I haven't investigated as much as you did though, so I cannot guarantee that this is the exact same issue. On 2021-12-12 14:47 levone1 @.***> wrote: > So can you try setting TMPDIR to a directory that is actually > writeable by your user? > > There is no point in manually creating the tmpfiles with root > access, preview-tui will fail to write to them. So I had a bright idea to copy my nnn from my Linux container to my SF fs, and now it works. Happy that it works, but still no satisfaction of finding out what the issue was.... The nnn I have installed in Linux is installed via apt, while the one I had on SF was built from git clone... One difference is that my Linux uses libncursesw6.0, while the SF fs is on 5.9, so had to copy/symlink... Anyway, thank you all for your quickness to support, and bear with me... -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: #1252 (comment)

I just re-ran getplugs sh right away, since I couldn't remember for sure if my script was modified... I don't know if I actually used yours, since I'm on aarch64, and I don't think your source was available, so I just built from source. I think the first time I had the problem was because of the lack of tput command, which I'm now realizing may have been the issues this time, too, (but I forgot about it). I don't remember what I did to fix it then, but I'm pretty sure it had to do with ncurses also... Maybe the default Jolla ncursesw doesn't include tput, or...?

--
You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/jarun/nnn/issues/1252#issuecomment-991910382