Skip to content

Commit

Permalink
fixup! feat(virtualenv): look up VIRTUAL_ENV_PROMPT first
Browse files Browse the repository at this point in the history
Co-authored-by: Janne Mareike Koschinski <[email protected]>
  • Loading branch information
scop and justjanne authored Jun 17, 2024
1 parent a307d69 commit 3241c1b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion segment-virtualenv.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import (
func segmentVirtualEnv(p *powerline) []pwl.Segment {
env := os.Getenv("VIRTUAL_ENV_PROMPT")
if strings.HasPrefix(env, "(") && strings.HasSuffix(env, ") ") {
env = env[1 : len(env)-2]
env = strings.TrimPrefix(env, "(")
env = strings.TrimSuffix(env, ") ")
}
if env == "" {
venv, _ := os.LookupEnv("VIRTUAL_ENV")
Expand Down

0 comments on commit 3241c1b

Please sign in to comment.