Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide commands to split the terminal #7504

Closed
Tyriar opened this issue Jun 9, 2016 · 63 comments
Closed

Provide commands to split the terminal #7504

Tyriar opened this issue Jun 9, 2016 · 63 comments
Assignees
Labels
feature-request Request for new features or functionality on-testplan terminal Integrated terminal issues
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented Jun 9, 2016

After multiple terminals are added, it would be useful to see multiple terminals at once. Open question: how does focus interact with tabs and splits?

@Tyriar Tyriar added feature-request Request for new features or functionality terminal Integrated terminal issues labels Jun 9, 2016
@Tyriar Tyriar self-assigned this Jun 9, 2016
@bpasero
Copy link
Member

bpasero commented Jun 10, 2016

Are you proposing to be able to split the panel side by side like the editor?

@Tyriar
Copy link
Member Author

Tyriar commented Jun 10, 2016

@bpasero Atom's term3 has the capability apparently, the package doesn't seem to be working for me though. Would want to see if it's a reasonable experience first.

@bpasero
Copy link
Member

bpasero commented Jun 10, 2016

@Tyriar oh I see so the terminal itself would split in the panel, we would not add splitting support to the panel?

@Tyriar
Copy link
Member Author

Tyriar commented Jun 10, 2016

@bpasero yes, this would be contained within the specific panel. Not to be confused with #7161

@Tyriar
Copy link
Member Author

Tyriar commented Jun 10, 2016

Another issue that's related to this: Add maximize panel command #7314

@bearguns
Copy link

Would be great to be able to split integrated terminal / task output in the bottom pane.

@Tyriar
Copy link
Member Author

Tyriar commented Jun 13, 2016

@bargeruns that would be this one #7161 😃

@rebornix
Copy link
Member

Personally I prefer sticky tabbing instead of window splitting as the window size is always too small ... something like tmux window would be great :)

@Tyriar
Copy link
Member Author

Tyriar commented Jun 14, 2016

Going to close this off in favor of programs like tmux and screen which seem to work just fine within vscode

image

@Tyriar Tyriar closed this as completed Jun 14, 2016
@Tyriar
Copy link
Member Author

Tyriar commented Jul 14, 2016

Reopening, I'm probably not going to learn tmux personally but would definitely find this useful. Also I don't think there is a solution on Windows.

@rkeithhill
Copy link

And I'm not sure tmux/screen would help those of us who use PowerShell in their terminal window.

@Tyriar
Copy link
Member Author

Tyriar commented Aug 16, 2016

@rkeithhill yeah that's one of the reasons I reopened, there's a similar discussion on this topic in #10546

@wclr
Copy link

wclr commented Aug 21, 2016

@Tyriar
Right for windows it doesn't work, and VSCode could provider more appropriate and convenient solution for naming navigating spited terminals. I would even consider some more flexible UI for terminals, for example where you could change split (or all) terminals amount and their size.

@selfup
Copy link

selfup commented Apr 12, 2017

So I set my shell to bash.exe and everything was working fine up until the newest update.

Now tmux can only cover half the width of the terminal instead of all of it 🤔

incomplete-tmux-width

Opened a new issue since this a bug: #24630

@wclr
Copy link

wclr commented Apr 25, 2017

@Tyriar Isn't it possible anyhow currently create a terminal in editor pane? (via API)?

@Tyriar
Copy link
Member Author

Tyriar commented Apr 25, 2017

@whitecolor track that in this issue #2806

@jens1o
Copy link
Contributor

jens1o commented Feb 14, 2018

is that based on another terminal's defaults? Also is that to split left/right or focus left/right?

It's to split, focusing is done by the mouse cursor(perhaps Tab when screenreader mode).
I had set that, because I've got used to it, but I don't know anymore how I invented those mappings.

@Tyriar
Copy link
Member Author

Tyriar commented Feb 14, 2018

@jens1o ah ok, currently the thinking is to just have a split horizontal/vertical as opposed to split to left/right to simplify it a bit. Good to know though 😃

@jakeleboeuf
Copy link

Focusing right/left would be v nice.

@millergarym
Copy link

key bindings are one of the first things I change post vscode install.
Here are my two for terminalFocus navigation.

    {
        "key": "ctrl+tab",
        "command": "workbench.action.terminal.focusNext",
        "when": "terminalFocus"
    },
    {
        "key": "ctrl+shift+tab",
        "command": "workbench.action.terminal.focusPrevious",
        "when": "terminalFocus"
    },

@Tyriar
Copy link
Member Author

Tyriar commented Feb 17, 2018

Here's an update of things that have changed since my last comment:

  • You can split more than once
  • The panes are rotated automatically when you move the panel to the right and back
  • You can split via the context menu
  • There are commands/keybindings to resize the active pane
    • macOS: cmd+ctrl+arrow
    • Linux/Windows: ctrl+shift+arrow
  • Double clicking the sashes (lines between the panes) will "reset" the pane sizes, making them all equal
  • Panes are kept to be all equal size unless the user explicitly resizes them
  • The focus pane commands now let you use up/down as well which is more natural when the panel is to the right

We also decided to restrict splitting to a single dimension for the time being to simplify the UX and implementation. We could always add splitting both vertically and horizontally at the same time later if needed (eg. if you can pull the terminal/panel out into a different window or #34442 in the future).

Most of this will be in Monday's build in a few days.


Things left to do:

@selfup
Copy link

selfup commented Feb 17, 2018

This is awesome news! Thanks @Tyriar 🙏

@Usamaliaquat123
Copy link

Thanks @Tyriar great implementation 🙏

@felixse
Copy link
Member

felixse commented Feb 19, 2018

I would propose selecting a different keybinding for Windows, since this would override the default keybindings of PSReadLine, which comes preinstalled since PowerShell 5.
Maybe alt + shift + arrow?

@Tyriar
Copy link
Member Author

Tyriar commented Feb 20, 2018

@felixse we generally stay away from alt for default keybindings, ctrl+shift+d has other issues though as it is used to toggle the debug viewlet.

Tyriar added a commit that referenced this issue Feb 20, 2018
@tvvignesh
Copy link

@Tyriar Great work. This may be far fledged. But can this be a future implementation: https://user-images.githubusercontent.com/688617/30918650-2a2db238-a36d-11e7-95ff-8bb25b6d43fe.gif

This was mentioned by @plmrry in #10546

Cheers for the great work you guys do.

@Tyriar
Copy link
Member Author

Tyriar commented Feb 21, 2018

@tvvignesh you would probably also be able to do that if these 2 issues got resolve #10546 #14909

@copdips
Copy link

copdips commented Feb 21, 2018

@Tyriar
So many thx for this great job, although we have only the vertical split for the moment, it's already awesome for us.

BTW, I suggest to create a new repo which has only the terminal part (maybe we can also keep the extension part), and let anyone others to contribute to this magical powershell console.

@Tyriar
Copy link
Member Author

Tyriar commented Feb 21, 2018

@copdips I've heard that a lot this week 😄, tracked in #34442

Tyriar added a commit that referenced this issue Feb 23, 2018
@Tyriar
Copy link
Member Author

Tyriar commented Feb 23, 2018

I've pushed a change to the keybindings, cmd+d has been dropping in favor of ctrl/cmd+\ so that splitting the terminal uses the same keybinding as the editor:

Primary: ctrl+\ (mac: cmd+)
Secondary: ctrl+shift+5

@AshCoolman
Copy link

Am using this now. I will never go back.

@willisplummer
Copy link

This is awesome! What's the keybinding for switching keyboard focus between split windows?

@Tyriar
Copy link
Member Author

Tyriar commented Mar 3, 2018

@willisplummer alt+arrow or cmd+alt+arrow

@brennongs
Copy link

@Tyriar I haven't been able to find quick keybind or command for closing the currently focused terminal panel. Is that possible/in the works?

@plmrry
Copy link

plmrry commented Mar 15, 2018

@brennongs I was looking for the same thing. Turns out you can add a key binding for workbench.action.terminal.kill and it will close the currently focused pane:

{
    "key": "cmd+w",
    "command": "workbench.action.terminal.kill",
    "when": "terminalFocus"
}

(in keybindings.json)

@wclr
Copy link

wclr commented Mar 15, 2018

@Tyriar what about splitting terminal horizontally?

@Tyriar
Copy link
Member Author

Tyriar commented Mar 15, 2018

@brennongs there is no default keybinding for this.

@whitecolor you can only do that if the panel is vertical currently. See #7504 (comment)

@wclr
Copy link

wclr commented Mar 15, 2018

@Tyriar ok

I didn't notice that it can be veritical. Maybe if it would be possible to have multiple terminal panes as editor panes and possible to split editor panes vertically and horizontally (like in VIM). Then there would be no need for terminal's split. =)

@Tyriar
Copy link
Member Author

Tyriar commented Mar 15, 2018

@whitecolor there's a different between splitting tabs in multiple directions and splitting panes though.

@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality on-testplan terminal Integrated terminal issues
Projects
None yet
Development

No branches or pull requests