justjanne / powerline-go

A beautiful and useful low-latency prompt for your shell, written in go
GNU General Public License v3.0
2.73k stars 268 forks source link

No prompt in pyvenv.cfg makes venv incorrectly empty #373

Closed matthubb closed 2 months ago

matthubb commented 1 year ago

The new ini check will incorrectly blank out env if there is no prompt value in the ini file. https://github.com/justjanne/powerline-go/blob/fe0a2a494012c4edb7cc83e512d3efd1c7a7bc13/segment-virtualenv.go#L19

I'm not that familiar with golang, perhaps assigning the output of the ini lookup to a temporary value and checking it's not empty before overwriting env would suitably resolve this issue?

new_env = cfg.Section("").Key("prompt").String()
if new_env != "" {
        env = new_env
}
elebertus commented 1 year ago

https://github.com/justjanne/powerline-go/pull/387 - this change resolved the issue for me. Waiting for review.