Console.log messages do not appear in VSCode terminal window - visual-studio-code

I'm doing an Electron tutorial using VSCode as my editor in Windows 10.
My main.js file contains only one line: console.log('main!');
When I open the terminal view (Ctrl+`) in VSCode and type "npm start" the console.log command does not display.
However, when I open a cmd.exe to and run "npm start" the "main!" console.log command appears.
I've tried changing the default terminal for VSCode to cmd.exe instead of powershell but had the same results.
What can I do to get my console.log command to appear in the VSCode terminal window?

Related

How to open VSCode from command prompt as its own thread without hijacking the terminal?

On Windows, when I open a folder from the terminal in VSCode with the "code ." command, it opens VSCode correctly but the terminal window becomes a slave, running all console commands from the app without returning command to me. If I close the terminal, VSCode also closes, it seems that the application thread is being run as child of the terminal process that gets killed with its parent. The same does not happen with "xp . ", my shortcut for the file explorer.
My question is how to make VSCode open as its own process letting the terminal be free.
Found the solution:
cmd /c start "VSCode" "code.exe" .

Hide CMD After opening VScode from Run window in Windows

I am trying to hide CMD After opening VSCode from Run window in Windows and don't work, I test those solutions
How to exit Command Prompt after launching VSCode
But it didn't work.

CanĀ“t run python files anymore Visual Studio Code

Out of the blue VSCode stopped running my python files. When I try to run it the python terminal opens but nothing happens. When I try to debug it says "timed out waiting for launcher to connect".
Has anyone a solution?
This worked for me:
Changing your "integratedTerminal" shell to cmd.exe will fix it, because it's using "PowerShell".
Open a new terminal pane : Press Ctrl+` (or View > Terminal in menu)
Open a "Command Prompt" Open a "Command Prompt"
Switch "cmd" to default (DO NOT switch to PowerShell)
Switch to default profile

Command executes after I open new bash terminal in vscode

Somehow, at some point, I set the command to execute when a new terminal in vscode is opened and I can't figure out where it is set. I have checked vscode settings.json (global and local) with no luck. This command is not executed when starting a new bash, but after it is initialized, that is, I see the command as below:
norbert#DESKTOP-2E05HS2:/mnt/c/Users/Norbert/Desktop$ conda activate user
When I type bash in the console to open a new shell, this command is not executed. This only happens when I open a new terminal via vscode.
Any ideas?
BR
Norbert

Visual Studio Code Opens and run scripts on the non-default terminal

Until yesterday, my VSC worked fine. I opened, edited, and run my python scripts without a problem.
However since today when I start my VSC session, it starts on Powershell Terminal, that doesn't recognize my conda enviroment despite I set the default terminal as cmd:
When I open the cmd terminal manually, automatically loads my conda env, however when I run the command "Run Python File in terminal" it always opens on Powershell
Any suggestion on how to fix this?