jarun / nnn

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

preview-tui: 1: eval: Syntax error: "(" unexpected #1895

Closed FunctionDJ closed 3 months ago

FunctionDJ commented 3 months ago

When i try to use the preview-tui plugin while hovering on a folder that's named something like this Foo (Bar) [Bat], the plugin doesn't work and preview-tui: 1: eval: Syntax error: "(" unexpected is logged which is visible when exiting nnn afterwards.

I'm running nnn on a remote machine with tmux for the tiling.

I've looked at probably related issues and PRs like #1617 and #1614 but couldn't figure out if there is a fix for this.

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

Exact steps to reproduce the issue

N-R-K commented 3 months ago

The issue template asks for some environment details. Please provide them, especially your bash version and preview-tui version.

FunctionDJ commented 3 months ago

@N-R-K pardon, i didn't look at the bug template correctly and deleted everything instead of what i should. i have edited the issue above.

regarding the preview-tui version, i don't know where i can find it. i've read the plugin file at ~/.config/nnn/plugins/preview-tui and no version is mentioned there. i'm running nnn v4.8-1 though, according to apt policy nnn (nnn -V doesn't appear to list the -1).

regarding "Issue exists on nnn master", i don't really know how to build binaries and i was hoping that it's okay to open issues without being able to compile nnn.

N-R-K commented 3 months ago

regarding the preview-tui version, i don't know where i can find it.

It doesn't have an explicit version. I'm going to assume that it's the one that came with your nnn version.

i'm running nnn v4.8-1

There were some fixes made to preview tui since 4.8. Try downloading the latest one from master and see if that fixes your issue.

nnn -V doesn't appear to list the -1

That -1 part is probably ubuntu's package revision number.

N-R-K commented 3 months ago

the plugin doesn't work and preview-tui: 1: eval: Syntax error: "(" unexpected is logged which is visible when exiting nnn afterwards

I tried this on master and cannot reproduce. Also, the current preview-tui script doesn't have any eval since commit 432b0755d33f5d7c0f9e085939338aa0644c17e9.

I'm closing this off as fixed by 432b0755d33f5d7c0f9e085939338aa0644c17e9. Upgrading to v4.9 or above should fix your issue.

FunctionDJ commented 3 months ago

@N-R-K i was finally in a situation where i could upgrade to Ubuntu 24 LTS, shipping nnn 4.9 in their repo.

Unfortunately despite removing and reinstalling the plugins, the preview-tui plugin seems to be fully broken for me now. When i trigger the plugin (regardless of where, even in an empty directory), it prints size missing right into nnn on top of the first entry, without creating a tmux split.

thezacharytaylor commented 2 weeks ago

I have this issue on Mac 14.6.1 Sonoma. I've replaced the preview-tui code after it didn't work redownloading it, but it persists.