Skip to content

Batch activators unexpectedly turn echo off for subsequent commands #2411

@pawelszramowski

Description

@pawelszramowski

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions