Skip to content

Commit

Permalink
Merge pull request #210 from buckley310/hostname
Browse files Browse the repository at this point in the history
fix hostname display when custom colors are set
  • Loading branch information
justjanne authored Jun 23, 2020
2 parents acd9378 + d520fde commit 093b715
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions segment-hostname.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ func segmentHost(p *powerline) []pwl.Segment {
}

if *p.args.ColorizeHostname {
hostName := getHostName(p.hostname)
hostPrompt = hostName

foregroundEnv, foregroundEnvErr := strconv.ParseInt(os.Getenv("PLGO_HOSTNAMEFG"), 0, 8)
backgroundEnv, backgroundEnvErr := strconv.ParseInt(os.Getenv("PLGO_HOSTNAMEBG"), 0, 8)
if foregroundEnvErr == nil && backgroundEnvErr == nil {
foreground = uint8(foregroundEnv)
background = uint8(backgroundEnv)
} else {
hostName := getHostName(p.hostname)
hostPrompt = hostName

hash := getMd5(hostName)
background = hash[0]
foreground = p.theme.HostnameColorizedFgMap[background]
Expand Down

0 comments on commit 093b715

Please sign in to comment.