79559486

Date: 2025-04-07 09:31:11
Score: 0.5
Natty:
Report link

For anyone landing on the question, and in the absence of a better answer... what I've gone with in the end is installing daemonize (homepage, homebrew) which does exactly what I want - detach a process from a VSCode-derived terminal such that it survives the terminal being closed. The emulator line, above, now looks like:

daemonize "$( which emulator )" -avd Pixel_7_Pro_API_34 -no-boot-anim

(daemonize didn't seem to use the PATH so I resolve the emulator executable for it).

It's also possible to remove the if pgrep -x "qemu-system-aarch64" >/dev/null; then... condition by using the -l lockfile option but to achieve the logging I have in place I'd have to implement error handling so left it as-is for now.

I'd still be interested in how to do this directly in zsh without relying on a separate third-party tool, however well it works.

Reasons:
  • RegEx Blacklisted phrase (1): I want
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
Posted by: Robin Macharg