Jump to content

VSCode - Not Using Integrated Terminal

ATawko
Go to solution Solved by DPS100,
5 hours ago, ATawko said:

Thank you for taking the time to assist!


I did not have a launch configuration set for this, so I went ahead and created one. Unfortunately this yielded the same result.

image.thumb.png.d41aaa8dba438d2ddc3a32b562a5c24a.png

 

The launch configuration has the specified line included;


{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal"
        }
    ]
}

Additionally please see settings.json below from \AppData\Roaming\Code\User\settings.json


{
    "workbench.editorAssociations": [
        {
            "viewType": "jupyter.notebook.ipynb",
            "filenamePattern": "*.ipynb"
        }
    ]
}

 

I don't believe any other relevant settings have been modified.

One of the first steps taken was a fresh install of both Python and VS Code.

 

During the installs of both, the only optional setting used was to add them into PATH.

image.png.2e3fa505fa780868ff575193b7474b1b.png

 

I looked at my settings.json file, and I see a line that you didn't include in your snippet that could be of use:

"python.languageServer": "Microsoft"

However, I don't know if this will be of use in case you use a different interpreter.

 

Another idea may be to try using the ">Python: Run Python File in Terminal" command. I don't think it will fix the issue but it could be a temporary way to circumvent it.

image.png.ce25d9e4696a84a405f5152c1ccae675.png

Hello!

 

Throwing this out to the wind in hopes someone might know what I've got setup wrong.

After a computer reset, I had to reinstall Python and Visual Studio Code.

 

Every time I run a program now it opens in a new Python window, instead of using the terminal in VSCode.

This is causing a ton of headache, especially when things crash or error an I'm not able to catch the error in time on the other window.

 

I've included an image of this as well, as seen in the image my Python script opens in another window.

Any thoughts / suggestions?

image.thumb.png.f333dde39b8f10c8aa311e7ba7f9423f.png

Thanks!

ATawko

 

Link to comment
Share on other sites

Link to post
Share on other sites

14 hours ago, ATawko said:

Hello!

 

Throwing this out to the wind in hopes someone might know what I've got setup wrong.

After a computer reset, I had to reinstall Python and Visual Studio Code.

 

Every time I run a program now it opens in a new Python window, instead of using the terminal in VSCode.

This is causing a ton of headache, especially when things crash or error an I'm not able to catch the error in time on the other window.

 

I've included an image of this as well, as seen in the image my Python script opens in another window.

Any thoughts / suggestions?

image.thumb.png.f333dde39b8f10c8aa311e7ba7f9423f.png

Thanks!

ATawko

 

 

Try looking in your .vscode folder for a file called "launch.json", and make sure that "console" is set to "integratedTerminal"

image.png.3834b68057fcf4ebf86e548ea5d605f3.png

 

EDIT:

On closer inspection, it looks like you may not have a launch configuration set. You can set one in the Run and Debug interface with the dropdown menu. If you don't have any launch configuration, hit the "Run" option in the top left, then click "Add Configuration...". This will open the .json file with launch configurations and prompt you with which launch configuration you would like to setup. Here is a link in case you need it: https://code.visualstudio.com/docs/editor/debugging#_launch-configurations 

Edited by DPS100
Added more instructions
Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, DPS100 said:

 

Try looking in your .vscode folder for a file called "launch.json", and make sure that "console" is set to "integratedTerminal"

image.png.3834b68057fcf4ebf86e548ea5d605f3.png

 

EDIT:

On closer inspection, it looks like you may not have a launch configuration set. You can set one in the Run and Debug interface with the dropdown menu. If you don't have any launch configuration, hit the "Run" option in the top left, then click "Add Configuration...". This will open the .json file with launch configurations and prompt you with which launch configuration you would like to setup. Here is a link in case you need it: https://code.visualstudio.com/docs/editor/debugging#_launch-configurations 

Thank you for taking the time to assist!


I did not have a launch configuration set for this, so I went ahead and created one. Unfortunately this yielded the same result.

image.thumb.png.d41aaa8dba438d2ddc3a32b562a5c24a.png

 

The launch configuration has the specified line included;

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal"
        }
    ]
}

Additionally please see settings.json below from \AppData\Roaming\Code\User\settings.json

{
    "workbench.editorAssociations": [
        {
            "viewType": "jupyter.notebook.ipynb",
            "filenamePattern": "*.ipynb"
        }
    ]
}

 

I don't believe any other relevant settings have been modified.

One of the first steps taken was a fresh install of both Python and VS Code.

 

During the installs of both, the only optional setting used was to add them into PATH.

image.png.2e3fa505fa780868ff575193b7474b1b.png

 

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, C2dan88 said:

What visual studio code extension you using for python?

I am currently using ms-python.python Version: 2021.5.842923320

image.thumb.png.77fa5a4c4b881f9698cddf750209e369.png

Link to comment
Share on other sites

Link to post
Share on other sites

5 hours ago, ATawko said:

Thank you for taking the time to assist!


I did not have a launch configuration set for this, so I went ahead and created one. Unfortunately this yielded the same result.

image.thumb.png.d41aaa8dba438d2ddc3a32b562a5c24a.png

 

The launch configuration has the specified line included;


{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal"
        }
    ]
}

Additionally please see settings.json below from \AppData\Roaming\Code\User\settings.json


{
    "workbench.editorAssociations": [
        {
            "viewType": "jupyter.notebook.ipynb",
            "filenamePattern": "*.ipynb"
        }
    ]
}

 

I don't believe any other relevant settings have been modified.

One of the first steps taken was a fresh install of both Python and VS Code.

 

During the installs of both, the only optional setting used was to add them into PATH.

image.png.2e3fa505fa780868ff575193b7474b1b.png

 

I looked at my settings.json file, and I see a line that you didn't include in your snippet that could be of use:

"python.languageServer": "Microsoft"

However, I don't know if this will be of use in case you use a different interpreter.

 

Another idea may be to try using the ">Python: Run Python File in Terminal" command. I don't think it will fix the issue but it could be a temporary way to circumvent it.

image.png.ce25d9e4696a84a405f5152c1ccae675.png

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, DPS100 said:

I looked at my settings.json file, and I see a line that you didn't include in your snippet that could be of use:


"python.languageServer": "Microsoft"

However, I don't know if this will be of use in case you use a different interpreter.

 

Another idea may be to try using the ">Python: Run Python File in Terminal" command. I don't think it will fix the issue but it could be a temporary way to circumvent it.

image.png.ce25d9e4696a84a405f5152c1ccae675.png

I think this might be the crux of the issue.

This command doesn't show in the runner.

 

I'm thinking somethings corrupt either with my Windows install or in some hidden files for VS Code.

I threw together a quick Windows VM to test and sure enough everything was working properly!

 

Looks like I've got some further digging / re-installing to do.

 

Thanks again!

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×