VSCode Python terminal output disappears - visual-studio-code

The terminal output just disappears. A few days ago VSCode started to show this weird behaivor when trying to run a Python code. However, running the code directly from the terminal seems to be okay. Does someone know why this is happening? As far as I know both output should be the same.
I have been using a VSCode for a while and am familiar with VSCode settings and set all to default except for the Default Profile: Command Prompt.
Image 1: Running with the play button
Image 2: Running with the terminal command

Related

VSCode hangs when trying to run a Jupyter notebook?

I am trying to run a Jupyter notebook in VSCode. I have successfully run notebooks in the past, but something has happened to make VSCode "hang" when I try running. When I hit run, the terminal shows the file location and the location of python.exe as expected (shown in the first image, with some personal information redacted), but nothing ever happens. The code never completes and the cells never output. I get a small "pending" icon of a clock and an arrow (shown in the second image) to tell me a cell is running, but even the most basic "Hello, world" never completes or gives an error. I have no trouble running regular python files, and if I export an ipynb to py I can run it, but I cannot run the ipynb itself. Trying to restart the Jupyter kernel also seems to hang, never completing and never crashing or erroring. The only clue I really have is that when I hit F5 to run, there's no python version showing in the bottom left corner, the way there is when I run py files (third image is while trying to run ipynb and fourth image is while successfully running py).
I have tried uninstalling and reinstalling the Jupyter extension from VSCode and restarting VSCode between every step. I have tried swapping between python.exe and conda.exe in the terminal settings python.condapath. I have checked that the windows terminal is cmd. I've tried creating new notebooks in VSCode that only have print("Hello, world"). I have tried the command "Select interpreter to start Jupyter server" and selected the correct version of Python, but nothing has changed any time I've tried to run.
I am using Anaconda version 4.10.3, VSCode 1.61.2, IPython version 7.9.0, and Jupyter notebook version 6.4.3.

VSCode will not run default terminal upon startup

For months I have been using Git Bash as my default terminal. Upon start up it loads 1 terminal plus any additional terminals as defined in my "terminals.json" file using the "Terminals Manager" extension. Everything has been working fine up until today, when I opened vscode up and it launched powershell instead of Git Bash for all my terminals. I have restarted vscode, and also restarted my pc but that did not help.
As mentioned above it is my default profile:
And here are my settings:
Also btw I can still run bash on vscode and it works just fine, however it won't run on start up anymore.
Any idea what is happening?

Bash terminal not allowing typing

I am attempting to use the integrated terminal within VS Code on a Windows 10 box with the bash terminal. I have been using this same setup since March, but now it all of a sudden will not allow me to type anything in the terminal. When I start VS Code the terminal opens, but with the screen scrolled all the way down, if I scroll up I can see the command prompt. If I try to type it just scrolls back to the bottom again and doesn't type the characters. Has anyone seen this before?
Visual Studio Code 1.47.1
Git Version 2.27.0-64-bit
I have been using Git Bash while this isn't working without issue.

Angular ng serve asking to open app and not working

Problem Statement
When I try to do ng s -o in my terminal for my Angular app, it says, "How would you like to open this?" inside a popup box where I can choose an app, but choosing an app doesn't work.
Image of Problem
When I try to choose an app, it displays code. When I chose Chrome in the popup box, this happens:
The image shows that when I run an app after ng s -o it just displays code. Also, the tab title in the browser says "ng" when the code shows. Another thing, there is no error in the terminal...
Expected Results
I want to run my Angular app with ng s -o.
Actual Results
The app doesn't serve and asks to open an app.
Note: I am using Visual Studio Code for this.
The problem was related to my cli. I was using PowerShell when I was running ng, and for some strange reason, PowerShell stopped running ng and was asking me to open an app to run the file. Even though this never happened to me before and I was using ng and PowerShell just fine before. Strange!
Now I am using CMD instead. It now runs perfectly. So, I switched cli's from PowerShell to CMD in my integrated terminal in Visual Studio Code and it started working.
I got the idea to switch cli's from this: https://github.com/Microsoft/vscode/issues/28541
npx ng serve -o works for me in visual studio code.
The problem was caused as the Vs code was using PowerShell mode. By changing it to default cmd mode, the ng commands started to work.
The steps to change from PowerShell to cmd mode is as follows:
Press Ctrl + Shift + P to show all commands.
Type profile in the displayed text box to filter the list.
Select Terminal: Select Default Profile.
You will be prompted to select your preferred terminal shell, you can change this later in your settings or follow the same process as we do now.

No output when running Python 3 in VScode

I'm using Python 3.8 on VScode, but I can't seem to get the program to write anything in output, even with simple commands like: print("Hello world!"). It shows up in the terminal well enough, so the code shouldn't be the problem. Do i need to fix anything in the setting to make it show the output?
1: Picture of terminal:
Please could you check your user settings.json and workspace settings.json for the existence of a setting for terminal.integrated.shell.*.
I believe you may have changed the shell to use command prompt instead of powershell.
Also, please could you provide some screenshots of the terminal
And any errors logged in the console widows (go to Help->Toggle Developer Tools)