tmuxp icon indicating copy to clipboard operation
tmuxp copied to clipboard

`run_before_script`: Allow daemonized functions to run

Open tony opened this issue 3 years ago • 3 comments
trafficstars

pipx install --suffix=@run_before_script 'tmuxp @ git+https://github.com/tmux-python/tmuxp.git@tn-run-before-script-daemonized'

re: #692

tony avatar Feb 28 '22 23:02 tony

Codecov Report

Merging #743 (9ebd7d6) into master (51f673a) will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #743   +/-   ##
=======================================
  Coverage   75.96%   75.96%           
=======================================
  Files           7        7           
  Lines        1190     1190           
  Branches      311      311           
=======================================
  Hits          904      904           
  Misses        199      199           
  Partials       87       87           
Impacted Files Coverage Δ
tmuxp/util.py 84.41% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 51f673a...9ebd7d6. Read the comment docs.

codecov[bot] avatar Feb 28 '22 23:02 codecov[bot]

this functionality may turn out may be better to put before running tmuxp load <session>, e.g.

kak -d -s sessionname && tmuxp load yoursession`

I thought of the fabled @bitprophet when I think of a way to launch a process to the background like a daemon into the background, "spawn it and forget about it". The examples on github search brought up fabric and invoke. In hindsight I realize the times I started mysql or postgres it was using those

@ttttcrngyblflpp @Segaja #692 is turning out to be harder than it looks when it comes to commands like that. Would running the script before tmuxp in shell do for the ones that happen in the background?

tony avatar Mar 01 '22 00:03 tony

At least for me it would be possible to execute the VPN connection before i call tmuxp, yeah. But maybe then it should be mentioned in the documentation that the before_script has problems with processes which try to fork into the background?

aschleifer avatar Mar 01 '22 17:03 aschleifer

@aschleifer Closed for now, per conversation here, and if you want to revisit this let me know :)

tony avatar Sep 11 '22 23:09 tony