I've been working on a bunch of different projects in VSCode and just to clear up some space on my desktop I decided to quit all VSCode applications. Upon reopening it, the Interactive Terminal's text too small to read. I know you can just launch terminal and execute the same command but out of convince's sake I want to be able to increase the size of it again. Example of my issue
You can change the terminal display settings with this configuration in your settings.json.
I saw your photo, and it looks like there is some minor problem. Just reload your window - Command + R on macOS, or select Developer: Reload Window after opening the command palette. That should work.
Related
i use the following setting so that when i switch to the terminal in vscode, it opens maximized:
{
"workbench.panel.opensMaximized": "always"
}
and when i switch to and from the editor via keyboard shortcut, this works great: full size editor and full size terminal.
my problem is when i am looking at the terminal, and switch to a file via the fuzzy finder or clicking on a file path, my terminal is now un-maximized and half-covering the editor. i'd like my view to either be full screen editor or full screen terminal panel. how can i get it to switch to the file, and completely hide the terminal panel?
The answer is to use Zen mode.
After getting more comfortable with awslogs, I am wondering if there's a way to actually open up or bring a terminal to the code editor view. For example, here's what I see in my iTerm2 app:
I don't really use iterm2 too much if I have to do some editing of files, but having this inside of VS Code in a tab would be really nice. Just would allow me to make changes to the Dockerfile and monitor the progress of the build from AWS.
Here's where I would like it to go:
I understand that this isn't really a "terminal" spot per se since it's typically at the bottom, but I was just curious to see if there was a way to do it without affecting the terminal on the bottom. In some rare cases it would be nice to attach to a tmux session from the code editor window so I can flip between that and code.
In the Insiders build now, and so presumably will be in v1.58, is the ability to put a terminal into an editor like you ask. You can also drag a terminal into the editor area to crop it there!
There are these commands:
Terminal: MoveTerminal into Editor Group
Terminal: Create Terminal Editor
workbench.action.terminal.moveToEditorInstance
This seems quite basic, but I can only seem to create vertical splits in vs code, and would like to be able to create horizontal but don't know what the command is to do so.
I have tried looking through the commands prefixed with Terminal: , but don't seem to have anything that will create a new terminal in a horizontal split. The command that I'm using to create a new terminal is Terminal: Create New Integrated Terminal
open a first terminal, then a second one, then right click a terminal: "move to editor area".
Configure default terminal location
In theory you can configure the terminal location, using Workbench > Panel: Default Location:
The setting ID is workbench.panel.defaultLocation
The JSON is:
"workbench.panel.defaultLocation": "left"
That doesn't work for me. Sounds like a bug.
Work-around
To work around this you can:
Pull up a terminal with Ctrl'
Right click on the TERMINAL tab
Select either "Move panel left" or "Move panel right"
Click into the panel
Hit CtrlShift5 to split the terminal
You now have two terminals, one above the other
I have also found that changing the alignment of the terminal panel can give some more width and prevent crammed text in a narrow terminal column. To do this go into the VSCode menu...
View -> Appearance -> Align Panel -> Justify
This will place the terminal below everything and give extra width because it is no longer crowded by the Primary Side Bar.
On the terminal panel click on Configure Terminal Settings
On the next screen change Default Location to editor
Now if you create terminals it will create it in editor window
Use tmux and use ITerm.app in your configuration
If you're like me and your cat walked on your keyboard and opened a split terminal somehow, you can close it by right clicking the split piece and select Kill Terminal.
in VSCode is it possible to open the terminals in a separate window?
So far my research has pointed to a resounding NO but Im curious if anyone has a solution?
Move terminals between windows
It's now possible to move terminals between windows by detaching via
Terminal: Detach Session in one and attaching to another with
Terminal: Attach to Session. In the future this should help enable
cross-window drag and drop!
Lots of changes in v1.58: https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_58.md#terminals-in-the-editor-area
For v1.59 moving the terminal changes - including dragging and dropping onto another window, see https://github.com/microsoft/vscode-docs/blob/vnext/release-notes/v1_59.md#drag-and-drop-terminals-across-windows
Drag and drop terminals across windows
Drag terminals from the tabs
list or editor area of one window into the tabs list, editor area, or
panel of another window.
Terminals in the editor area
Terminals can now be created in or moved to the editor area, enabling a multi-dimensional grid layout that persists and remains visible regardless of panel state.
To use terminals in the editor area, there are several options:
Create via the Create Terminal in Editor Area command.
Move a terminal from the panel to the editor by dragging and dropping from the tabs list.
Running Move Terminal into Editor Area with a terminal focused.
Moving into the editor area via the terminal tab context menu action.
The new terminal.integrated.defaultLocation setting can be set to editor to direct newly created terminals to the editor area by default.
Please Try:
File > Open New Window
Ctrl+Shift+P > Terminal: Create New Terminal in Editor Area
You can add keybinding to the commands as per your convenience.
i think that the OP wants to create a separate window for the terminal but still have the separated terminal linked to the code editor in the original window (that's what i want too). so that when you run the code in the editor the output is shown in the terminal in the separate window. but if you simply open up a new window of vscode and either open a terminal there or drag and drop the terminal from the original window into the new window, the new terminal is not the same session of the terminal. it is a separate independent unconnected terminal. running the code in the editor does not show output in the new separate terminal. all you have achieved is creating a new unconnected terminal. which you could have just accomplished by opening up a regular terminal window i.e. the one from windows os main menu, no need even to use vscode.
This answer is now outdated. See this answer for instructions on moving terminal panes between VS Code windows. This answer still works but is no longer a necessary workaround.
You can't detach the panes in VSCode, which IMO is a bit of a pain since Visual Studio can detach panes all day long.
There is a workaround though, you can open a new window in VSCode and maximize the terminal pane in that window.
One reason you'd want to do this is to have the Python terminal on a second monitor while still being able to use Python interactively (shift+enter way). Attaching/detaching didn't work for me, nor can you open separate terminals.
What you can do is simply resize your one window across the screen borders! Then right click on the terminal tab/header and click Move panel to the left and voila!
Try Сtrl+Shift+c.
For me, it opens the folder the script is within in a command prompt window.
Create a new window by going to File → New Window.
Open up a new terminal inside of it.
Go to your folder (cd your\projectfolder\path).
And here you are, you have a terminal for your project inside it's own seperate window.
You can change the terminal to be side-by-side instead of below the editor. And then make your window very wide. It is almost as good as having two windows.
Right click on the TERMINAL tab.
Select "Move Views to Side Panel"
Make your window very wide
It seems VS Code allows you to detach the terminal window, but it then will not show the output from the editor of the window you detached it from.
I have spent a while searching, and there is really no workaround other than to just run whatever file you are trying to debug from a separate terminal from the same CWD. This also means you will need to save the file in the window you are editing the file in every time you want to run it. huge pain.
If you are using PowerShell inside the VSCode terminal, why don't you use the PowerShell console from the start menu. It's basically equivalent to using the terminal in separate windows. Hope it helps.Sample
I want to run the select code of python in VScode. Till now, I have to copy the code and paste it in the terminal below to run. The system is mac OS.
So is there any way to run the code directly after I selected the code? For example, like the shortcuts.
Thanks.
There is no default keybindings for command "Run Selected Text in Active Terminal", but you can create one.
Press Ctrl+K, Ctrl+S to open File → Preferences → Keyboard Shortcuts.
Search for workbench.action.terminal.runSelectedText in keybindings.
Press the icon on the left to open a windnow with this message "Press desired key combination..." and make your choice. (I've pressed Ctrl+Alt+R - as this combination was not used yet.)
Press Enter to store your keybinding.
Tested on VSCode 1.30.2 on Windows 10 Pro.
#yanachen, this is now possible in VS Code. All you need to do is:
1. Ensure python is running in the VS Code terminal window
2. Select the text you wish to execute in python
3. Invoke the command 'workbench.action.terminal.runSelectedText' as defined in the following link:
https://code.visualstudio.com/docs/editor/integrated-terminal#_key-bindings
Now it's supported by default shortcut "shift" + "enter".
select the proper code snippet
press "shift" + "enter"
Here is the setting for running selection in "interactive window."
In my VS Code (version 1.56.2), I do the following things: go to Settings, search for interactive window, in the resulting left panel choose Jupyter, and finally check the box next to Jupyter: Send selection to interactive window. That's it. One more step for some users (including me) is to modify the keybinding for running selection to your preference. For example, got to keyboard shortcuts, type run selection, you should see a list of keybindings and you may need to redefine them if conflicts exist.
Some language specific extensions have already an existing keybinding.
On Windows, for the PowerShell extension it is currently F8 to run the selected text.
Install the vscode extension Node.js Exec. then select the block of code you want to run and press f8. worked for me.