zimfw / minimal

A minimal fork of subnixr's minimal prompt theme.
GNU General Public License v3.0
8 stars 3 forks source link

A regression prevents the indication of the active python virtual env in certain user environments #6

Closed aravinda0 closed 1 year ago

aravinda0 commented 1 year ago

Is your feature request related to a problem? Please describe.

I've updated zimfw and related modules after a long time and notice that there's no longer an indicator prefix on the prompt for my virtual envs.

This stems from the following environment conditions:

  1. I use poetry
  2. I have this in my poetry config: virtualenvs.in-project = true.
  3. The above config creates venvs in the /path/to/my/project/.venv folder.
  4. Since the trailing path of the venv ends with .venv, the +"${${VIRTUAL_ENV:t}%%.*} fragment of the PS1 string in this theme makes the resulting venv 'name' to be a blank string.

This seems to have been introduced in 4f2f88f52f6a314c8bc3d13a3517c76d946637a7

Describe the solution you'd like

The old behavior where it would end up showing venv as the prompt prefix to indicate an active venv.

Describe alternatives you've considered

I could change my poetry config, but I'm filing this as a request for consideration as:

  1. The behavior for this env used to 'work' before.
  2. I figure having a venv in the project directory under a .venv subdirectory is not an uncommon configuration.

Thanks :)

ericbn commented 1 year ago

This behavior was copied from the original subnixr's minimal, here. I agree .venv is a common name choice and it should be supported.