enricozb / popup.kak

Kakoune popup plugin
21 stars 2 forks source link

Popup close immediately #5

Closed waste37 closed 11 months ago

waste37 commented 11 months ago

When using popup with long lasting commands like bash the info modal closes immediately.

$ kak-popup popup --debug --kak-session test --kak-client client0 --height 24 --width 98 bash

kakoune::debug: waiting for quit
kakoune::debug: refresh::step: tmux display exited with non-zero status: exit status: 1, err: no server running on /tmp/tmux-1000/default

kakoune::debug: done waiting
kakoune::debug: failed to kill tmux session 1696265678731675959: tmux kill-session exited with non-zero status: exit status: 1, err: no server running on /tmp/tmux-1000/default

kakoune::debug: exiting popup
kakoune::debug: error: Capture::handle_output

Caused by:
    0: status
    1: No such file or directory (os error 2)
kakoune::debug: keys::step: tmux send-keys exited with non-zero status: exit status: 1, err: no server running on /tmp/tmux-1000/default

This is the output if no tmux instance is running. If otherwise there are some sessions the output is

kakoune::debug: waiting for quit
kakoune::debug: refresh::step: expected value at line 1 column 34
kakoune::debug: done waiting
kakoune::debug: failed to kill tmux session 1696265830200081365: tmux kill-session exited with non-zero status: exit status: 1, err: can't find session: 1696265830200081365

kakoune::debug: exiting popup
kakoune::debug: error: Capture::handle_output

Caused by:
    0: status
    1: No such file or directory (os error 2)
kakoune::debug: keys::step: tmux send-keys exited with non-zero status: exit status: 1, err: can't find pane: 1696265830200081365

It seems no session is being created in the first place. P.S. tmux works perfectly and there is no tmux.conf file on the system, that is Arch linux.

enricozb commented 11 months ago

Thanks for the OS info along with the report. I'll try to reproduce this on a docker image. I'm on nixos and I have no issues running bash.

enricozb commented 11 months ago

Out of curiosity, can you try running kak under root? When testing archlinux (under docker) it works for me:

docker run -it archlinux
# in docker container...

pacman -Sy kakoune tmux rust git
cargo install kak-popup

mkdir -p ~/.config/kak/autoload
git clone https://github.com/enricozb/popup.kak ~/.config/kak/autoload/popup.kak

export PATH=$PATH:~/.cargo/bin

kak

Then in kakoune :popup bash works for me. If I make a test user inside this docker container it still works for me though

enricozb commented 11 months ago

Additionally, can you try updating kak-popup? I've pushed a v0.4.2 to add some additional logging around this error:

kakoune::debug: refresh::step: expected value at line 1 column 34
waste37 commented 11 months ago

The first time i ran popup command in kakoune and it failed for the same reason as before: for some reason tmux sends an empty JSON like this to the display command:

{       "size": {         "width": ,         "height":        },       "cursor": {         "x": ,         "y":        }     }

even if there are no prior calls to Quit::quit from any other thread. After that i ran kakoune as root and it did work correctly. Now it also works for unprivileged user without problems of any kind. Thank you for the help.

enricozb commented 11 months ago

That is really weird... well thanks for helping with the debugging. I'm going to close this as there are other threads about similar behaviors.