VSCode mysterious command prompt window apearing in Debug Console - visual-studio-code

I seem to be pressing some keyboard shortcut that is opening a command prompt in the Debug console. I don't know what it is so can't find how to close it. Sometimes it covers half the debug console.
How do I close it? So far only restarting VSCode seems to get rid of it but that's inconvenient since I lose all my undo history that way, and it also closes the open simulator.

This console is inactive when you not debug something. Press Ctrl+Shift+Y to close it.
About the arrow on your screenshot: you can write commands to this prompt during debugging process. For example for gdb use -exec and type command you need.

Related

How to unfreeze the terminal in VScode after CTRL+S?

I purposefully froze my terminal with CTRLS in visual studio code, so that I could inspect the fast log messages scrolling through. Normally, you can unfreeze it again with CTRLQ.
However, it seems that vscode catches this second shortcut and instead of unfreezing my terminal, it opens this popup in the middle of the screen - which disappears as soon as I release the keys...
This seems to be called the "Quick Open View".
I assume that there is a way to send the "unfreeze" signal to the terminal. How?
My solution for now was to detach tmux in vscode, then connect over ssh using a normal terminal, attach tmux, send the CTRLQ there, detach and exit again, and re-attach in vscode.
you can remove any shortcuts you want. go to file > preference > keyboard shortcuts
type "ctrl q"
and adapt as you wish
I also ran into this issue,
I found that if you go into File -> Preferences -> keyboard shortcuts
When you find the Ctrl-q shortcut, you can right click it and choose to remove it,
then the Ctrl-q will work to resume the terminal

How to get Clean Terminal in VSC

I want to have a clean Terminal in VSC, but every time I run my code there is some useless stuff I would like to remove, for example my Microsoft Version and the path to my files.
Is there any way to remove them from my Terminal?
On all my other PC's I don't have this Problem, only on this PC. I already tried to change the console argument in my Launch.json but if I change it to InternalConsole it dosen't run the code anymore. Also it would show my results in the debugger and I would like to use the Terminal.
You can clear your Terminal after each run, by typing clear in Terminal. To have it done automatically, check 'Clear Before Reusing', or 'Clear Previous Output' (if you're using Code Runner) in Settings. To get there, press Ctrl + , on Win or Command + , on Mac and type 'clear' in the search box.
Sending the output to the Debug console looks cleaner, but it doesn't allow user input. Other than that, I don't think there's a way to not have the path of your file displayed as the file executes.

VS Code Terminal Not Allowing Typing

My VS code terminal was working fine, until one day when I tried to work on a project, that was still open in VS code, my terminal didn't allow me to type any commands. I couldn't type anything. This is the screen that I get.
Okay, for those of you struggling with the same problem, I've managed to solve it by clicking on the drop-down menu that says powershell and changing it to cmd.
this happened to me and simply
close vs code
right click on it
run as administrator
open the terminal and it will work
this problem happened when I changed the default path of CMD
For me, I tried using Powershell/CMD/Bash and I was having errors/blank terminal. I found typing echo hello and pressing CTRL + C made it appear. So in fact, everything was working, my terminal was just blank/glitched out, but was really accepting input.
I had a similar issue when running ionic serve command which runs the development server on the localhost. I paid attention after executing the command above, and it said:
Use Ctrl+C to quit this process
Pressing Ctrl+C then displays:
Terminate batch job (Y/N)?
Type Y or y
then the command prompt is shown again!
Here is a sample terminal window - trimmed for brevity:
For who has this problem using React. This happens when you start a live version using npm start. The terminal that handles the live version of the app cannot be used for anything else.
So to continue using the terminal you need to open a new terminal to use in parallel. To do so just click on the plus icon in the top right corner of the terminal panel then choose the "Power Shell" option. This will open a new terminal without restarting visual studio.
In Mac, when working with Python, this helped me: instead of clicking on the "Run Code" option, click on "Run Python file", in the right corner.
For Ubuntu users this is solved by this solution:
File -> Preferences -> Setting -> Features -> Terminal -> Inherit Env
I found two vscode on my desktop, I opened the other one and it worked. Looks like I updated it but the older one didn't disappear.
If typing Ctrl+C can help to get out of this frozen state, that will be easier to do with VSCode 1.64 (Jan. 2022)
The terminal can type the answer for you.
Terminal -- Auto-reply
The terminal is now able to automatically reply when a specific sequences of characters is received.
A good example of where this is useful, which is also the only default case, is the Windows batch script message Terminate batch job (Y/N)? after hitting Ctrl+C when running a batch script.
This typically just ends up causing problems for the user.
The terminal will now automatically reply with Y and enter (\r) which makes Ctrl+C in Windows feel much better.
Pressing Ctrl+C will immediately reply to the question and return to the prompt:
Theme: Sapphire
The feature was made generically so you can setup custom replies for other thing, just be careful when doing this as you are sending text to the process automatically.
For example you could use it to automatically update Oh My Zsh when prompted:
"terminal.integrated.autoReplies": {
"[Oh My Zsh] Would you like to check for updates? [Y/n]": "Y\r"
}
If you use Clink and enable their similar feature, you can disable it in Clink or in VS Code by setting the reply to null to avoid the two features conflicting with each other:
"terminal.integrated.autoReplies": {
"Terminate batch job (Y/N)": null
}
Go to terminal, preferences, settings.
Check "run code in terminal"
Restart VS.
I changed from bash to powershell in terminal first but the command prompt still not shown.
Then I navigate to File -> Perferences -> Settings and it starts working (command prompt shown)
This seems to just be a display problem. It happened to me when I changed my display settings for desktop icon and app scaling settings.
I managed to fix the problem by simply restarting my computer and re-opening VS code
I had the same problem ... In my case just run vs-code as administrator and works

Shortcut to the command prompt in VisualStudio Code

In VisualStudio Code, is there a keyboard shortcut to jump to the command prompt in the debug mode? It is somewhat tiresome to have to click at this prompt with the mouse every time.
EDIT 1
Using binding workbench.debug.action.focusRepl results in the following error:
If the debug console is closed, there is View: Debug Console (workbench.debug.action.toggleRepl) to open it. That one is bound to cmd+shift+y on macOS, should be ctrl-shift-y on Windows / Linux.
If the debug console is already open, you can either press the aforementioned shortcut twice or use the following command:
Debug: Focus Debug Console
It has no default shortcut, but you can bind it to whatever you like, the action is called:
workbench.debug.action.focusRepl

Enter pydev interactive console immediately on F11?

I would like to F11 a python file in Eclipse and when I hit a breakpoint automatically enter the Python Interactive Console (not the default pydev debug console).
I understand that I could upon entering debug mode open a new interactive python console (I have turned on the connection between the interactive console and the debug console) and work from there. But not only is that an extra step but it is frustrating because everytime I interact with such an interactive console it shoves me back to the debug console! Then I have to go review the interactive console. I also understand that I could do a 'runfile' from within the interactive console, but I really want to use the convenient F11 capacity of eclipse to just be in an editor, hit F11 and when I break enter the interactive console.
Basically I would like the Interactive Console to be my debug console. Possible?
If the F11 approach is not possible, is there another approach? My goal is to get my history of command typing available to me with arrow keys. Not possible in the default python debug console from what I can tell. Perhaps if I made the pydev debug console ipython?
Thanks, I have searched a lot on this but can't come up with a solution.
from PyDev 3.9.2 onwards, a console prompt with history, code-completion, etc. will appear automatically.
See: http://pydev.blogspot.com.br/2015/02/pydev-392-released.html for details.