chris-marsh / pureline

A Pure Bash Powerline PS1 Command Prompt
MIT License
501 stars 94 forks source link

duration_segment broken in macOS #69

Open lbogdan opened 2 years ago

lbogdan commented 2 years ago

Under macOS duration_segment fails with

-bash: (1638285455N: value too great for base (error token is "1638285455N")

This is because macOS's native date doesn't support %N. I tried installing coreutils from brew, but that installs it as gdate by default. At this point, there's 2 workarounds that I could think of:

  1. replace date with gdate in duration_segment

  2. (which I ended up using, suggested by brew) prepend PATH with /usr/local/opt/coreutils/libexec/gnubin to make the binaries installed by coreutils have precedence over macOS native ones

Not sure what a proper fix would be, just leaving this here for others running into it.