jarun/nnn

preview_tui needs extglob enabled

Closed this issue · 3 comments

  • Operating System:
    macOS
  • Terminal Emulator:
    kitty
  • Shell:
    fish (bash for this script
  • Issue exists on nnn master

Exact steps to reproduce the issue

Run preview_tui on mac and it crashes with

bash-3.2$ ~/.config/nnn/plugins/preview-tui
/.../.config/nnn/plugins/preview-tui: line 396: syntax error in conditional expression: unexpected token `('
/.../.config/nnn/plugins/preview-tui: line 396: syntax error near `+(g'
/.../.config/nnn/plugins/preview-tui: line 396: `  elif [ -n "$NNN_PREVIEWVIDEO" ] && [[ "$4" == +(gif|video) ]]; then`

I added shopt -s extglob; to the top of my script to fix it. Extglob is disabled by default.

You're running a seriously outdated bash version (v3.2 from 2006). Upgrade to a newer version and report back if issue still persists.

Closing as duplicate of #1774

3.2 is the version MacOS ships with, FYI. But yeah good to know.