abathur / lilgit

a smol (quick) git status prompt plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Better daemonization/service model

abathur opened this issue · comments

The current MVP model uses bash coproc for bi-directional I/O. Convenient for dev, but has a few issues:

  • the daemon is actually attached to the shell...
    • it may show up in your window/tab title
    • terminal may block on exit because lilgitd is running (workaround at least in macOS Terminal.app: Terminal > Preferences > Shell > add lilgitd to the ask-before-closing exception list)
    • common signals for the shell may kill it (tentatively addressed with dc9f749)
  • there's technically a process per terminal; it's pretty small (a few mb), but it is a little wasteful if you run many terminals (as I do)

An obvious answer is "do what gitstatus does", and I assume named pipes/fifos are part of the solution, but this is a bit of a blind spot for me. I've done one-way client communication to a service over a fifo, but I'm not sure what the simplest way to design around multi-client is.