Visual Studio Code can't encode cyrillic characters in output - unicode

Output in Visual Studio Code can't decode Cyrillic characters:
The same code works fine in PyCharm:
How do I quickly fix this issue? There must be some simple way.
Auto Guess Encoding in Settings doesn't work since it's for files, not the output.
Edit: the problem was the Code Runner extension in VSCode. Disabling it or running script in terminal does the job.

You can configure 'Code Runner' plugin to run your code in the integrated terminal.
Try it:
Open VSC Settings: Ctrl + ,
Search: code runner run in terminal
Click on checkbox.
Now your application with Cyrillic symbols run in Integred Terminal without encoding problems.

Related

Fonts in terminal of the Visual Studio Code (VS) Code

Visual studio code terminal
I cannot read the terminal . I changed the json file for the fonts but still I cannot read the letters in the terminal.
I changed json, terminal settings.
But unfortunately the fonts still cannot be read in the terminal.

PowerShell console in Visual Studio Code: How to copy-paste?

I cannot Copy-Paste from the Visual Studio Code console. In ISE one can copy-paste some of the output, but it does not seem to be possible in Visual Studio Code Terminal. How can I copy-paste the output from the console when running PowerShell commands? I have the PowerShell Extension.
Ctrl+C and Ctrl+V for copying / pasting work as-is in Visual Studio Code's integrated terminal.
By contrast, right-click behavior is configurable:
On Windows, the default behavior is to copy, if text is currently selected, and paste otherwise - as in regular console windows.
To get the same behavior as in the Windows PowerShell ISE, i.e. to instead show a shortcut menu, which contains Copy and Paste commands, add the following line to your settings.json file (before the closing }):
"terminal.integrated.rightClickBehavior": "default",
Alternatively, use the settings GUI (press Ctrl+,):
Note:
The screenshot was taken on macOS, where selectWord is the default setting; on Windows, it is copyPaste, with the behavior as described above.
Also note the GUI's convenient search feature: typing right click in the search field was sufficient to locate the relevant setting.

ANSI colors don't work in VSCode integrated terminal with PowerShell

I am using Visual Studio Code for my python project and I am also using flakeheaven (fork of the unmaintained flakehell package) to manage flake8 and other linters/plugins. When running flakeheaven lint, it tries to print the output nicely with colors. Here's how it looks on my terminal (Windows terminal using Powershell Core):
I like this feature. However, When I run the lint command in the integrated terminal in VSCode, it doesn't display the colors, and instead displays weird ANSI sequences:
It looks like VSCode can't display the ANSI colors correctly in the terminal. I'd like to know if there is a way to fix this to get the same colorful output as in the external terminal.
Is there a way to make VSCode terminal display colored ANSI output correctly?

Visual Studio Code is not taking input from keyboard when I use C++ or Java

While taking input from the user using C++/Java, program is running successful and Visual Studio Code does asks user to input, but when I try to enter anything like a number or a character, it takes no input.
Your program is running in Output tab, therefore it is not possible to take input. Just enable Run in terminal in Visual Studio Code Settings.
Settings (ctrl+,) -> Search settings, look for code runner: run in terminal (check)
Note: It is supposed that you have Code Runner extension installed.
Go to extensions (Ctrl+shift+X) and install code Runner.
Go to Settings. (File ---> Preferences --->Settings)
Search Code Runner, then check
code runner: run in terminal

visual studio code running executables on current code

I'm new to Visual Studio Code and have a few extensions installed, but what I want is to do what I do in notepad++ and set up a command so I can execute the open file (e.g. vbscript). I can do this easily in notepad++ but I've no idea how to do it in VS Code and the internet seems to not have much help either.
If it is possible, can it be done like the Python vs code extension and have the output window in a pane below the code?
thanks.
There is actually an Extension that will run a number of different languages for you.
Install the Code Runner Extension
Open the code file in Text Editor, then use shortcut Ctrl+Alt+N, or press F1 and then select/type Run Code, the code will run and the output will be shown in the Output Window.