oh-my-posh/segment_shell.go
2020-09-20 19:48:24 +02:00

28 lines
425 B
Go

package main
import "strings"
type shell struct {
props *properties
env environmentInfo
}
func (s *shell) enabled() bool {
return true
}
func (s *shell) string() string {
p, err := s.env.getParentProcess()
if err != nil {
return "unknown"
}
shell := strings.Replace(p.Executable(), ".exe", "", 1)
return shell
}
func (s *shell) init(props *properties, env environmentInfo) {
s.props = props
s.env = env
}