Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#458 コメント 6 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
30/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
shell, zsh
領域
cli, tooling

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Shell
スター
6.7k
フォーク
429
平均マージ
7日 23時間
マージ済み PR(30日)
3

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

pyenv/pyenv-virtualenv のほかの issue

pyenv/pyenv-virtualenv の issue をすべて見る

似ている issue

Shell/Bash の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。