diff --git a/src/font/install.go b/src/font/install.go index 9aff5d1f..450286df 100644 --- a/src/font/install.go +++ b/src/font/install.go @@ -7,7 +7,11 @@ import ( "bytes" "io" "path" + "runtime" "strings" + + "github.com/jandedobbeleer/oh-my-posh/src/platform" + "github.com/jandedobbeleer/oh-my-posh/src/platform/cmd" ) func contains[S ~[]E, E comparable](s S, e E) bool { @@ -69,5 +73,10 @@ func InstallZIP(data []byte, user bool) ([]string, error) { } } + // Update the font cache when installing fonts on Linux + if runtime.GOOS == platform.LINUX || runtime.GOOS == platform.DARWIN { + _, _ = cmd.Run("fc-cache", "-f") + } + return families, nil }