Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Env's name disappears from the prompt when spawning a subshell

Abierto
#458 6 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
30/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
shell, zsh
Área
cli, tooling

Línea de trabajo

Start by reviewing the pyenv setup in ~/.zshrc and the .python-version file, then reproduce the behavior with zsh -l in a directory using the environment. Done means the environment remains active after the subshell starts, including the prompt and the downstream effects described in the issue.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

I am using zshell (default for Mac) and have pyenv installed. The way pyenv works is that it will automatically switch between virtual environments depending on which folder I'm in and which folder I switch to using the .python-version file. The code that enables this is run inside my ~/.zshrc file, and it's pretty boilerplate for pyenv.

I can tell my environment is running because I have something like this at the beginning of my prompt (myenvironment) folder $ in my zsh.

But when I open a new session by typing $ zsh -l, I don't have the same prompt, (myenvironment) goes away.

So what I do to fix things is type cd .., hit enter, then cd - hit enter, and we're done.

Interestingly, it won't actually work if I do cd .. && cd - or cd .. ; cd -, but when I do what I described, I get the prompt above.

What I am looking for is a way to do this automatically... any tips? Is this a bug that can be fixed or some way to invoke the environment change... there are downstream effects of this, and it's not just the prompt that I care about, I just assume it's out of scope for this ticket.

Lenguaje dominante
Shell
Estrellas
6.7k
Forks
427
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de pyenv/pyenv-virtualenv

Todos los issues de pyenv/pyenv-virtualenv

Issues similares

Más issues de Shell/Bash

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.