Fork me on GitHub
#babashka
<
2022-04-06
>
rickheere13:04:18

with sh or babashka/process how can I launch another process and then detach? Like fire and forget.

borkdude13:04:35

@rickheere babashka/process already does that automatically by being async. with sh this isn't possible since it waits for the process to finish

1
rickheere13:04:56

Aah, yes that works. Very cool. Thanks.

Cora (she/her)13:04:16

detaching isn't exactly the same as async. on unix-like systems it's usually done by fork + setsid + fork

Cora (she/her)13:04:35

unless that's not what they mean 😅

borkdude13:04:29

it's technically something different, no doubt, but the user is happy :)

🎉 1
Cora (she/her)13:04:55

some day my knowledge of this stuff will become useful again! today is not that day

rickheere13:04:28

Yeah in this case I just want the bb script to launch an application and then have my terminal back. So good enough for me at this moment.

Cora (she/her)14:04:40

yeah the only gotcha there is if your terminal receives SIGHUP and it passes that on to child process groups

Cora (she/her)14:04:49

but it sounds like that's not an issue here

🤞 1
borkdude20:04:10

A markdown library by @asko304 that also works in bb: https://github.com/askonomm/clarktown

❤️ 3
borkdude22:04:57

Another interesting thing that works with babashka: https://twitter.com/borkdude/status/1511829490732777477

👏 3
Daniel Jomphe11:04:18

RCF is quite deep in use of macrology and async stuff, if I remember well. This speaks well of bb!