air icon indicating copy to clipboard operation
air copied to clipboard

Make pre_cmd background forkable

Open omani opened this issue 3 months ago • 3 comments

Im trying to use pre_cmd = ["/usr/bin/xdotool sleep 1 search --onlyvisible --classname Navigator windowactivate --sync key F5 &"]

to refresh the browser once the binary (golang echo framework) started. hence the sleep so the refresh happens after the http listening on the port is available.

I need to put the xdotool command into background & because otherwise air will wait for the command to finish and then run the webserver. which will obviously fail.

I checked the code for the runner. it seems that forking into background exits the process immediately (the exec commad in utils_linux.go is "/bin/sh -c"...so ofc air wont wait and dismiss the command right away.

so my question is: any chance to implement a background forkable pre_cmd and the appropriate directive in air.toml?

omani avatar Mar 23 '24 21:03 omani