python / python/cpython

venv: activate.fish breaks prompt (prints directory) due to "echo 'exit $old_status' | ." line

Open
#140,006 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stdlib topic-venv type-bug
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Bug report

Bug description:
python3 -m venv test
source test/bin/activate.fish

causes ls-like output on every command.

Fix in venv/scripts/common/activate.fish:

        # Output the original/"old" prompt.
        _old_fish_prompt
        # Restore the return status of the previous command.
       return $old_status

fish, version 4.1.2

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs
  • gh-144558
  • gh-150936

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with python3 -m venv test and source test/bin/activate.fish, then inspect venv/scripts/common/activate.fish around the prompt restoration and return-status handling. Compare the proposed change with linked PRs gh-144558 and gh-150936; done means activating the environment no longer prints directory-like output while preserving the previous command status.

Written by the indexing model from the issue text.

Assessment

Tech stack
fish, python
Domain
tooling
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.