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

Unable to use plugins after opening shell #1335

Closed
FerrisWasTaken opened this issue Apr 1, 2022 · 7 comments
Closed

Unable to use plugins after opening shell #1335

FerrisWasTaken opened this issue Apr 1, 2022 · 7 comments
Labels

Comments

@FerrisWasTaken
Copy link

FerrisWasTaken commented Apr 1, 2022

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

  • [x ] Operating System: Ubuntu 21.10
  • [x ] Desktop Environment: i3-gaps
  • [x ] Terminal Emulator: kitty
  • [x ] Shell: zsh
  • [x ] Custom desktop opener (if applicable):
#!/usr/bin/env sh

# Description: open files with xdg-open
#
# Shell: POSIX compliant
# Author: Arun Prakash Jana 
# Modified: Ishaan Subramanya

sel=${NNN_SEL:-${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.selection}

if [ -s "$sel" ]; then
    files=$(tr '\0' '\n' < "$sel")

    for entry in $files; do
        if [ "$entry" != "$1" ]; then
            xdg-open "$entry" &
        fi
    done
fi
xdg-open "$1" &
# Clear selection
if [ -s "$sel" ]; then
    printf '-' > "$NNN_PIPE"
fi
  • [x ] Program options used: -dieaHQr -P p p being the key for preview-tui

  • [x ] Configuration options set:
    NNN_FIFO=/tmp/nnn.fifo
    NNN_OPENER=/home/muppi/.config/nnn/plugins/multi
    NNN_OPTS=''
    NNN_PIPE=/tmp/nnn.fifo
    NNN_PLUG='p:preview-tui;f:finder;j:autojump;c:cddir'
    NNN_TMPFILE=/home/muppi/.config/nnn/.lastdir

  • [x ] Plugins are installed

  • [x ] Issue exists on nnn master

Exact steps to reproduce the issue

  1. compile nnn with O_NERD enabled
  2. set NNN_PLUG to any example plugin
  3. start nnn
  4. start plugin it will open
  5. press ! to start a shell
  6. exit shell
  7. try to start plugin again a message will popup with "failed!"

Extra information

when the error occurs
[3] <PID>
[3] + <PID> done printf "%s\0" "0c${PWD}" ! > "${NNN_PIPE}"
is printed to the terminal with different PID's

@N-R-K
Copy link
Collaborator

N-R-K commented Apr 1, 2022

I can't reproduce. You'll need to provide a minimal reproduction steps.

But looking at this:

when the error occurs
[3]
[3] + done printf "%s\0" "0c${PWD}" ! > "${NNN_PIPE}"
is printed to the terminal with different PID's

I'm willing to bet this is due to your custom opener. Specifically, the fact that you're opening up jobs in the background.

@FerrisWasTaken
Copy link
Author

FerrisWasTaken commented Apr 1, 2022

I'm willing to bet this is due to your custom opener. Specifically, the fact that you're opening up jobs in the background.

Not the custom opener I unset NNN_OPENER and then tested again but still the same issue.

@N-R-K
Copy link
Collaborator

N-R-K commented Apr 1, 2022

NNN_PIPE=/tmp/nnn.fifo

NNN_PIPE isn't something you should have set manually. It's set automatically by nnn when invoking plugins. Unset it.

And if that still doesn't work, then unset everything and try to reproduce with vanilla nnn.

@jarun
Copy link
Owner

jarun commented Apr 1, 2022

Program options used: -dieaHQr -P p p being the key for preview-tui
NNN_PIPE=/tmp/nnn.fifo

If you set NNN_FIFO you shouldn't use the program option -a.

@jarun
Copy link
Owner

jarun commented Apr 1, 2022

NNN_PIPE=/tmp/nnn.fifo

This is not user-defined.

@jarun jarun closed this as completed Apr 1, 2022
@jarun jarun added question and removed bug labels Apr 1, 2022
@FerrisWasTaken
Copy link
Author

FerrisWasTaken commented Apr 2, 2022

And if that still doesn't work, then unset everything and try to reproduce with vanilla nnn.

after bringing my nnn env variables to

NNN_PLUG=p:preview-tui
NNN_TMPFILE=/home/muppi/.config/nnn/.lastdir

The issue persists.
NOTE: the exact output of

export | grep NNN

is

NNNLVL=1
NNN_FIFO=/tmp/nnn-fifo.2298297
NNN_INCLUDE_HIDDEN=1
NNN_OPTS=''
NNN_PLUG=p:preview-tui
NNN_TMPFILE=/home/muppi/.config/nnn/.lastdir

@N-R-K
Copy link
Collaborator

N-R-K commented Apr 2, 2022

Still can't reproduce. It's probably some env related issue. Try compiling nnn with make O_DEBUG=1 and then attach the log (should be at /tmp/nnndbg).

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

No branches or pull requests

3 participants