4

I am using Visual Studio Code on my Windows 10 PC. I want to change my default terminal from 'Windows PowerShell' to 'Python' (on Windows). Someone help me solve this issue.

Kumara
  • 480
  • 1
  • 4
  • 13
  • Does this answer your question? [VSCode Change Default Terminal](https://stackoverflow.com/questions/44435697/vscode-change-default-terminal) – PowerShellGuy Nov 29 '21 at 17:22
  • No I want python as my default terminal this suggestion gives a common answer but not for python. If I can set python as my default terminal, please give that explanation in detail. Because I am a new learner of programming languages – Kumara Dec 01 '21 at 17:20

1 Answers1

4

Press Ctrl+Shift+P to bring up the command palette and run the Terminal: Select Default Profile command:

Run command

Select Default Profile

If Python does not appear here, add a profile for it manually in your JSON configuration. Press Ctrl+Shift+P and run the Preferences: Open User Settings (JSON) command:

enter image description here

Add the following lines in your JSON config file and save it:

"terminal.integrated.profiles.windows": {
    "Python": {
        "path": "python",
        "args": []
    }
},

Afterwards you should be able to select Python as your default terminal profile.

carlfriedrich
  • 2,919
  • 1
  • 15
  • 29
  • Sorry, I tried this method but that didn't show the method I am asking. – Kumara Dec 01 '21 at 17:22
  • Do you mean it does not display Python as an option? Do you have Python installed? – carlfriedrich Dec 01 '21 at 18:26
  • Yes it doesn't display python as an option but I have installed python. – Kumara Dec 02 '21 at 14:18
  • Alright, I extended my answer with information on how to add a Python terminal profile. – carlfriedrich Dec 02 '21 at 14:38
  • Thank you for your answer it solved my problem :) – Kumara Dec 04 '21 at 07:08
  • This doesn't seem to work. I searched for "json", and while some of the other suggestions appeared, including "Preferences: Open Default Settings" & "Preferences: Open User Settings", the raw "Preferences: Open Settings" I did not see. I tried copy-pasting to one, just in case, but it did not work. I then searched for "Preferences: Open Settings", and one of the results was "Preferences: Open Settings (UI)" - it's no longer a JSON file. I do not think it would be a duplicate to ask this exact same question again. – Post169 Feb 02 '23 at 20:40
  • @Post169: You are right, "Settings" seem to have been renamed to "User Settings" in a recent VS Code update. I updated the answer accordingly. – carlfriedrich Feb 03 '23 at 08:58