logoalt Hacker News

deathanatosyesterday at 4:17 AM0 repliesview on HN

https://github.com/thanatos/dotfiles/blob/master/shell/zsh/p...

That was my prompt when it was written in zsh. Sort of like TFA, I've since moved to Rust:

https://github.com/thanatos/dotfiles/blob/master/zsh-prompt-...

I think (if I am reading TFA's code right) unlike the article, I'm using zsh's module functionality, so the Rust here is a .so that is loaded directly into the shell's memory. (I.e., I do not have to fork/exec a separate Rust bin to compute the prompt, though I think zsh might fork-but-not-exec for computing the prompt itself.)

The latter is, of course, somewhat more complicated in some senses. (Esp. on macOS, which work forces me to use, where dlopen(2) is just utterly insane.)