skip to Main Content

enter image description hereMy VS Code is appending the miniconda3 path to the Power Shell prompt
every time I execute any code. This causes the PS prompt to be super long.

e.g.

PS C:UsersnameProjectsPython Tutorials> **& C:/Users/name/miniconda3/python.exe "c:/Users/name/Projects/Python Tutorials/Instance_in_Python.py**"

I would like the command prompt to end at:

PS C:UsersnameProjectsPython Tutorials>

and print the program’s output and not append this extra line after it:

**& C:/Users/name/miniconda3/python.exe "c:/Users/name/Projects/Python Tutorials/Instance_in_Python.py**

I have attached a screenshot of the PS prompt in VS Terminal for your perusal.

I have also searched this forum for any possible solution for this issue but unfortunately could not find any.

Is this due to the location of my Python file and the project files or something else? Any help in reducing this command prompt line would be highly appreciated.

2

Answers


  1. I am not sure if you would be happier with this, but a VScode extension code-runner looks well-known.

    enter image description here

    Installing this extension enables you to see [Run Code] option with your python script, and at least it makes you save lines from including whole absolute path for your python.exe.

    enter image description here

    Login or Signup to reply.
  2. My VS Code is appending the miniconda3 path to the Power Shell prompt every time I execute any code. This causes the PS prompt to be super long.

    vscode uses the system terminal as the integrated terminal, that’s how it works. There’s nothing wrong with that.

    If you insist on cleaner output, you can use Code Runner and keep the following settings.

        "code-runner.runInTerminal": false,
        "code-runner.clearPreviousOutput": true,
        "code-runner.showExecutionMessage": false,
    

    enter image description here

    But I still recommend you to use the official extension Python (Run Python File) to execute the script.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search