enricozb / popup.kak

Kakoune popup plugin
21 stars 2 forks source link

popup window not show up #3

Closed YuFei29 closed 5 months ago

YuFei29 commented 1 year ago

I installed kak-popup and add "evaluate-commands %sh{kak-popup init}" to kakrc according readme, but when i "popup fish", the popup window does not show up and there's nothing in debug buffer.

I also tried HEAD version kakoune and kak-popup, popup window also does not show up.

Is there anything I missed?

Screenshot 2023-07-10 at 19 50 55
enricozb commented 1 year ago

How did you install popup.kak

YuFei29 commented 1 year ago

I have tried both manual and via pulgin manager bundle

# manual installed inside kitty terminal
cargo install kak-popup
# and add line  "evaluate-commands %sh{kak-popup init}" to kakrc
# via package manager
bundle popup.kak https://github.com/enricozb/popup.kak.git %{
    source "${kak_opt_bundle_path}/popup.kak/rc/popup.kak"
} %{
    cargo install --force --locked --path .
}

I also tried my configuration in my opensuse virtual machine. When popup for the first time, the popup window flashed (appeared but disappeared soon), and when I tried again later, the window never appeared or flashed again.

enricozb commented 1 year ago

Ok I'm going to ask you to help me debug this issue since I don't have a mac. Here are the testing instructions:

  1. Start a kakoune instance with no source files:
    kak -n
  2. Initialize popup.kak inside that kakoune session:
    :evaluate-commands %sh{kak-popup init}
  3. Get the current kakoune session, client, and window size:
    :echo %val{session} %val{client} %val{window_height} %val{window_width}
  4. Then, in a separate terminal, use those values to start a kak-popup instance in debug mode:
    kak-popup popup --debug \
     --kak-session <session> \
     --kak-client <client> \
     --height <height> \
     --width <width> \
     fish

If nothing appears on the kakoune side, please tell me if there is anything in the *debug* buffer. Additionally, please tell me what the output of the kak-popup command is.

YuFei29 commented 1 year ago

here is what I get

kakoune::debug: waiting for quit
kakoune::debug: refresh::step: tmux display exited with non-zero status: exit status: 1
kakoune::debug: done waiting
kakoune::debug: failed to kill tmux session 1689268367728914000: tmux kill-session exited with non-zero status: exit status: 1
kakoune::debug: keys::step: quitting
kakoune::debug: exiting popup
kakoune::debug: error: Capture::handle_output

Caused by:
    0: status
    1: No such file or directory (os error 2)

I have tried again and again, sometimes I get this

kakoune::debug: waiting for quit
kakoune::debug: refresh::step: expected value at line 3 column 22
kakoune::debug: done waiting
kakoune::debug: failed to kill tmux session 1689269259204322000: tmux kill-session exited with non-zero status: exit status: 1
kakoune::debug: exiting popup
kakoune::debug: error: Capture::handle_output

Caused by:
    0: status
    1: No such file or directory (os error 2)
Screenshot 2023-07-14 at 01 12 03 Screenshot 2023-07-14 at 01 12 05

sometimes output are different

Screenshot 2023-07-14 at 01 28 00

I have tried in my openSUSE virtual machine, get the same

Screenshot 2023-07-14 at 01 34 19
enricozb commented 1 year ago

Do you have a non-default tmux configuration? If so this could be the cause. It's on my TODO list to have popup.kak spin up tmux sessions that don't use the user's configuration, but instead just a default one.

enricozb commented 1 year ago

What's the output of the following commands:

tmux new-session -s testing -x 50 -y 50 -d fish
tmux resize-window -t testing -x 40 -y 10
tmux capture-pane -t testing -p -e
tmux kill-session -t testing

A screenshot is fine.

YuFei29 commented 1 year ago
Screenshot 2023-07-14 at 15 56 43
enricozb commented 1 year ago

can you please run them separately instead of all at once, though I think I was expecting an error anyways...

YuFei29 commented 1 year ago

can you please run them separately instead of all at once, though I think I was expecting an error anyways...

I quit it completely and reopen a new window, it's just nothing... I have tried macos's default Terminal.app, just the same.

Screenshot 2023-07-14 at 16 00 20
enricozb commented 1 year ago

Sorry I meant like, instead of running all of the commands in a single interaction with the fish prompt, run them one by one, like this: image

YuFei29 commented 1 year ago
Screenshot 2023-07-14 at 16 03 22
enricozb commented 1 year ago

Sigh, okay. Give me a bit to try reproducing this on an OpenSUSE VM, since I can do that.

enricozb commented 1 year ago

How did you install Kakoune and tmux on OpenSUSE? I'm not familiar with this distro so I'm not sure which package managers are available.

enricozb commented 1 year ago

While I'm waiting for your instructions on installing the deps on OpenSUSE, I tried it on an Arch Docker image and it worked fine:

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 doing :popup bash works as expected: image

enricozb commented 1 year ago

Ok I've pushed a new version of kak-popup, version v0.4.0, if you can install that and rerun the debug commands from this answer, that would be awesome. I've added a small snippet for hopefully a better debug output.

YuFei29 commented 1 year ago

How did you install Kakoune and tmux on OpenSUSE? I'm not familiar with this distro so I'm not sure which package managers are available.

sorry for my delayed reply, you can install package with zypper

zypper install package
zypper in package # they are the same
YuFei29 commented 1 year ago

While I'm waiting for your instructions on installing the deps on OpenSUSE, I tried it on an Arch Docker image and it worked fine:

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 doing :popup bash works as expected: image

I have tried what you did, it works for me, I can see popup window show up and work. So I tried this on opensuse, but popup does not show up. Here are what I did

docker run -it opensuse/tumbleweed

zypper in kakoune tmux git
zypper in rustup
rustup install stable
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:/root/.cargo/bin

kak
YuFei29 commented 1 year ago

Ok I've pushed a new version of kak-popup, version v0.4.0, if you can install that and rerun the debug commands from this answer, that would be awesome. I've added a small snippet for hopefully a better debug output.

What I get

kakoune::debug: waiting for quit
kakoune::debug: refresh::step: tmux display exited with non-zero status: exit status: 1, err: server exited unexpectedly

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

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

Caused by:
    0: status
    1: No such file or directory (os error 2)
Screenshot 2023-07-15 at 09 01 27 Screenshot 2023-07-15 at 09 01 34
YuFei29 commented 1 year ago

Ok I've pushed a new version of kak-popup, version v0.4.0, if you can install that and rerun the debug commands from this answer, that would be awesome. I've added a small snippet for hopefully a better debug output.

what i get on opensuse

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

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

kakoune::debug: exiting popup
kakoune::debug: keys::step: tmux send-keys exited with non-zero status: exit status: 1, err: no server running on /run/tmux/1000/default

kakoune::debug: error: Capture::handle_output

Caused by:
    0: status
    1: No such file or directory (os error 2)
Screenshot 2023-07-15 at 09 14 56
enricozb commented 1 year ago

Ok I think we're getting to the root of the error here. I'll try the opensuse docker image, should make debugging and iteration easier. Thanks a ton for the info.

enricozb commented 1 year ago

Okay got it working on OpenSUSE: image

Please test out the new version v0.4.1.

Additionally on OpenSUSE, I wasn't able to start tmux out of the box. This happened:

5b560f959751:/ # tmux new-session -s kakoune kak
couldn't create directory /run/tmux/0 (No such file or directory)

so I had to run mkdir -p /run/tmux. Not sure why that's needed...

Lastly, I don't think this is the same issue on macOS, but we'll see.

YuFei29 commented 1 year ago

I have tested on OpenSUSE, it works when you are root user but not work for normal user. Not work on macOS.

enricozb commented 10 months ago

Sorry for the hiatus. In response to https://github.com/enricozb/popup.kak/issues/4 I've made some changes that might fix your issue. Can you please try v0.5.1

Song-Tianxiang commented 6 months ago

Works for me! I'm the author open this issue and I lost my email. You can close this issue now. Thanks for your work.

EDIT. I found debug message "popup-handle-output: on_err=dismiss status=0" in debug buffer, Is it done intentionally

enricozb commented 6 months ago

Works for me! I'm the author open this issue and I lost my email. You can close this issue now. Thanks for your work.

EDIT. I found debug message "popup-handle-output: on_err=dismiss status=0" in debug buffer, Is it done intentionally

Yes this is intentional, it happens when a popup closes.