tmux-python / tmuxp

🖥️ Session manager for tmux, build on libtmux.
https://tmuxp.git-pull.com/
MIT License
4.06k stars 231 forks source link

`before_script` cannot start headless kakoune #692

Open ttttcrngyblflpp opened 3 years ago

ttttcrngyblflpp commented 3 years ago

Attempting to start a headless Kakoune session in a before_script causes tmuxp loading to hang forever. The Kakoune session is started correctly (so the script "completed" successfully), and an empty tmux session is started, so it looks like tmuxp is somehow waiting for before_script to complete even though it already has. This probably has something directly to do with the exact mechanism that Kakoune uses to "daemonize" itself, but nevertheless since running the command in a shell completes successfully, it should work as a before_script.

Steps to reproduce:

  1. Have before_script: kak -s -d mykaksession in a config.
  2. Run tmuxp load mytmuxp.yml

Observed Results:

Expected Results:

Segaja commented 2 years ago

I can see the same issue when you try to start an openconnect VPN connection with the --background flag.

If I put this in a script and run as a normal command on my shell it works, i enter my credentials and the process forks into the background.

When I run the same script as before_script in tmuxp it establishes the VPN connection and openconnect says it forks into the background but then nothing happens. I can see with another terminal that the tmux session is started but the panels are not created.

This is currently the main issue why I can't migrate my work to tmuxp.

Segaja commented 2 years ago

@tony if you need any help testing or debugging this please let us know. I'm happy to test stuff out, if you tell me what to do.

tony commented 2 years ago

@Segaja Is this a command you're putting & after?

@tony if you need any help testing or debugging this please let us know. I'm happy to test stuff out, if you tell me what to do.

Can you think of a basic linux command that'd recreate the hang (without needing to installing a package)? That'd make it easier to simulate in our tests

Segaja commented 2 years ago

Hm, I would have to think about that. I guess the problem lies in how these programs fork into the background after their initial execution.