# agzd is also the noise I made trying to figure out the right incantation to get this to work. # specifically, we need -z to get it to read the *entire* file. read -agzd \n _mizu_vcs_output <$_mizu_vcs_output_file

what i'm actually doing here: i want to update the vcs status of my prompt asynchronously, so i

  • create a tempfile
  • spawn a background process, which synchronously:
    • tries the vcs backends (jj, then git)
    • writes newline-delimited output to that file
    • sends SIGUSR1 to the main process when it dies
  • when the main process gets SIGUSR1, it then
    • reads the output into the array _mizu_vcs_output
    • tells fish to redraw the prompt
    • the bit of the prompt responsible for the vcs reads from that array
the point of all of this is that i want fish_prompt to execute inside a single frame, which means about 7ms. time git status gives about 8ms on my pretty small repo, and time command true is like 5ms. with the async hack, time fish_prompt is about 2ms.

@saikou yeah. I've had the problem of git status blocking zsh prompt output.

Curious how this works out for you :)