jarun / nnn

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

[bash] nnn can't return after executing command (] key) if invoked from a `bind -x` keybinding. #1884

Closed magpie514 closed 1 month ago

magpie514 commented 1 month ago

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

Exact steps to reproduce the issue

  1. bind -x ' "\eo":"nnn" ' (for example)
  2. Press alt+o to run nnn
  3. Press ] to open the command prompt
  4. Run a command such as git pull
  5. After command is finished, it'll get stuck and unable to return.
  6. Process has to be killed by external means (kill, pkill, GUI task managers, closing the tab, etc)

Additional notes

I have nnn compiled with this script:

cd ~/Repositories/nnn
git fetch origin && git reset --hard origin/master && git clean -ffdx
make O_STATIC=1 O_NORL=1 O_EMOJI=1 strip
sudo cp ./nnn /usr/local/bin/nnn
N-R-K commented 1 month ago

After command is finished, it'll get stuck and unable to return.

Ctrl+c worked for me.

magpie514 commented 1 month ago

Tried ctrl+c as one of the first things, it doesn't work for me. Neither does ctrl+z or other control keys.

N-R-K commented 1 month ago

This seems to be a issue with bash bind: https://stackoverflow.com/questions/16928761/why-will-a-script-not-accept-input-on-stdin-when-invoked-from-bashs-bind

Not sure if there's anything to be done on nnn's side.

magpie514 commented 1 month ago

Good find. Yeah seems it's not nnn's fault, better close this one. Thanks for your assistance!