visualstudio code C++ terminal for output - c++

When debugging a C++ application on linux using, VisualStudio Code, an instance of an external terminal window is opened, and the applications console appears on this window.
This is a bit inconvenient because I have to change windows to see the output when debugging.
Is it possible to have the output to appear in a "pane" like the built in terminal appears (like the one started by CTRL-`)? If so how can this be done?
I have tried changing the launch file's "externalConsole" from true to false but this didn't work.

You need to use the Integrated Terminal.
View > Toggle Integrated Terminal

In launch.json set "externalConsole": false,.
Then the output goes to the Debug Console.
But instead of things looking like:
Hello World!
It will show up as:
#"Hello World!\r\n"
I have read that they still work in proper terminal support for the terminal inside VSCode. I think that also explains why it defaults now to the external terminal.

Related

How can I change the default behaviour of "Terminal: Explorer Kind" in VS Code Settings? [duplicate]

I have a Console application open in VS Code. When I press Ctrl-F5, the output of my program is displayed in a DEBUG CONSOLE window, along with other text.
How do I get Visual Studio code to launch my program in a new console window?
As documented here this can be achieved using this setting:
"console": "externalTerminal"
The settings file is in the solution directory: .vscode/launch.json .
When you're just using Tasks and not Launchers, you can follow the advice here.
For me on Linux, I changed my shell command in VSCode from command to gnome-terminal -e command. That did the trick; that's all I had to do.
Note that if you do this you can get rid of the presentation option set from your task.

How to view output of C program in VS Code's integrated terminal while debugging

I have VS Code setup for running C/C++ code using the code runner extension, and everything runs pretty smoothly except for debugging. When I debug the program, the code gets compiled with the built-in build task and not code-runner, and the resulting output is shown in a separate console window, which is frustrating to work with when debugging, due to the active window focus issues. I want the output to show up in the integrated terminal in VS Code, just like it does during normal compilation using code-runner. Other answers on Stack Overflow suggest to include this in the launch.json file:
"console": "integratedTerminal",
but this piece of code seems to be outdated and unsupported in the current version of VS Code. Instead, looking at the IntelliSense suggestion, I tried including this in the launch.json file:
"externalConsole": false".
This does stop the external console from opening, although the integrated console does not show any output either, and now I'm left clueless as to where to view the output.
So how do I get the output while debugging to show up on the integrated console?
If you are using type: "cppvsdbg" on launch.json, unfortunately, the integrated terminal is not supported yet. So, you wont be able to get the output on the integrated console while debugging.

Qt Application not running

I am trying to run a simple "Hello, world" console application but I am experiencing some errors when compiling that I am not familiar with. I have done a bit of research into similar problems with Qt but I haven't been able to find a solution. The closest solution I have come across was to change my Patch Command setting under:
Preferences -> Environment -> System -> Patch Command
to
usr/bin/xterm -e
However, when I try to do this it goes red indicating that I do not have this file.
Environment Preferences Window
The following image is a screenshot of what is displayed in the terminal window when attempting to compile my project.
Console Application Output
Any help on this problem would be much apprectiated! It is very frustrating having something like this hold me back!
Don't run your project in a terminal unless you actually select a working terminal, and that's all. The patch command is irrelevant in this anyway - it's not the terminal, but the patch command -- used to patch source code. You don't need it unless you explicitly use code patching. Go to Projects (Ctrl-5), click on the active Run configuration for your project, uncheck "Run in terminal", done.

Glitchy font when running start command from ConEmu

Before I start...
my tool chain consist of MinGW, ConEmu, and Vim to make C++ programs.
I wanted to test to see if MinGW was working by seeing if g++ was setup correctly on my system PATH, and it turned it was because I successfully compiled a simple console program that outputted the text I provided to standard out. However, I came across this...
When I do the command start test.exe from window's cmd shell in ConEmu (I use the start command because I want it in its own standalone prompt), the text looks like this.
These little white lines are annoying and I would like to know what's causing it...
When I run the standalone from the explorer it looks completely normal.
Is there something in ConEmu's settings that's causing this that anybody is aware of ?
I found a work around. I just end up using the program called cmder. Which is practically ConEmu but with more features built on top of it.

running C++ program on xcode

when I run a simple C++ program on Xcode, the compiler says it's built successfully, but there is no output. how can I make the result show up? thanks!
Cmd-Enter is the default "build and run" keyboard hotkey. Once you've pressed that, use Cmd-Shift-R to open the console and see your program's output.
in the tab Groups and file, under the xcode icon of your project there are 3 folders, Source, Documentation, Products, under Products there is your executable.
hth