VSCode: Not enough space to split terminal - visual-studio-code

In Visual Studio Code, there is a thing similar to command prompt in windows. It is called Terminal. In the past, I normally opened more than 3 tabs of this Terminal. However, in recent updates it displays this error when I try to open more than 3 tabs.
Not enough space to split terminal.
Is there a solution or a workaround for this?

Workaround:
Menu: View -> Appearance -> Toggle Panel Position (it moves terminals to the bottom) or right-click the "TERMINAL" or other tab and select "Move Panel to Bottom".
You can now open an additional terminal (or more) and then use the same menu option to move them back to the right and it will keep the additional terminals open.

There is a workaround - at least when You're using Ubuntu. You just have to unmaximize the window and resize it to make it bigger then Your screen size. Then You can split the terminal and can freely go back to initial window size.
Unfortunately, as far as I know, Windows won't allow You to have a window bigger that Your screen size. I don't know about Mac though.

Related

How to create a terminal with a horizontal split in visual studio code

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.

VSCode cycle through opened files only within its own split window

Say I have 2 split windows with a few files opened in both of them as shown in the image below. I'm using the shortcut keys (on mac) "cmd+shift+[" or "cmd+shift+]" to cycle through all the opened files ("Open Previous/Next Editor"). However I was wondering if we could lock the "next" opened file that we will cycle to to be within the current split window that we are on?
i.e. Say right now I'm on 'window 2' (the split window on the right according to the image), pressing "cmd+shift+[" would bring the focus to the left split window and onto the "Untitled-4" file, but is there a way to prevent that and make it cycle to "Untitled-5" instead?
In Linux, I can use Ctrl+Tab or Ctrl+Shift+Tab to do this.
its actually the default behavior of vscode, it will cycle through opened files on the certain split window only. on the windows you could use ctrl+tab to do this
So I've found the option to perform what I wanted.
It's the "View: Open Next/Previous Editor in Group" command.

How to move Output or Terminal back into the panel in the window layout?

Recently in VS Code, somewhere around v1.42 or v1.43, we gained the ability to move around the following windows/panels that used to be stuck in the panel:
Terminal
Output
Debug Console
Problems
They could be split into multiple items in the panel itself (side-by-side or top/bottom, depending on whether the panel was at the bottom or left/right), and even dragged into the side-bar.
This was great, but after moving all of these windows to the side-bar while experimenting, I can't find any way to move them back into the panel. The panel is now empty, except for 3 dots (an ellipsis) in the upper left corner. You can still hide/show the panel, and move it left, bottom, or right, but there is nothing in it, and you can't drag anything to it. Dragging the terminal into the panel shows an icon that looks like it will successfully move (it's not the icon with the circle/cross-out you get other places it won't drop), but when releasing the click-drag, nothing happens.
I had just upgraded to v1.45.0 when this happened. It appears to be a defect, unless I'm missing something. Does anyone have a way to put the terminal or one of these other windows back in the panel, or reset their position? I combed the settings, and tried to find default setting's files (system or user) that might hold info on what is in the panel vs. the sidebar, etc., but couldn't find anything via search or on my PC. Any ideas?
Note: This is NOT about moving the panel between the left/right/bottom positions, or selecting the terminal/output/etc. in the panel itself. That's "old news", this is a recent feature.
Here is a view with the Terminal, Output, Debug Console, and Problems put at the top of the sidebar toolbar, and Terminal focused. The Panel is just to the right of the sidebar window, set to the "left" position, completely blank and useless. The "welcome" window on the far right side:
And here are my current settings:
See this issue https://github.com/microsoft/vscode/issues/96117 (Empty panel behaves weird)
Suggested fix:
Run the command View: Reset View Locations in the command palette.
Please see: https://www.technipages.com/visual-studio-reset-window-layout
Menu Window / Reset Window Layout worked for me in VS 2019

How to make the "typing screen" bigger in vscode

How can I make this window bigger in VS Code?
I cant see the continued of the methods
Goto the View menu, then Appearance and Zoom In (Ctrl++). This will make the quick suggestions window bigger.
Afterwards, in the Settings.json you can reduce the "editor.fontSize" again until it fits your needs.
You can also try Full screen mode along with other options.
Press Ctrl+K and then Z to open editor in full screen without explorer and terminal, etc.
And you can use Ctrl+B to show/hide side bar and Ctrl+J to show terminal and console panel.

VSCode - Open terminals in a separate window

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