Skip to content

Batch activators unexpectedly turn echo off for subsequent commands #2411

Closed
@pawelszramowski

Description

@pawelszramowski
Contributor

Issue

Consider the following batch script:

python -m virtualenv --quiet venv
CALL venv\Scripts\activate.bat
REM spam
CALL deactivate.bat
REM eggs

The expected output is:

W:\>python -m virtualenv --quiet venv

W:\>CALL venv\Scripts\activate.bat

(venv) W:\>REM spam

(venv) W:\>CALL deactivate.bat

W:\>REM eggs

The actual output is:

W:\>python -m virtualenv --quiet venv

W:\>CALL venv\Scripts\activate.bat

This is caused by @echo off at the beginning of both scripts that need to be undone after calling them:

python -m virtualenv --quiet venv
CALL venv\Scripts\activate.bat
@ECHO ON
REM spam
CALL deactivate.bat
@ECHO ON
REM eggs

Environment

  • OS: Windows 10
  • pip list: not relevant

Output of the virtual environment creation

Also not really relevant. virtualenv version 20.16.4.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @gaborbernat@pawelszramowski

      Issue actions

        Batch activators unexpectedly turn echo off for subsequent commands · Issue #2411 · pypa/virtualenv