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

Add support for multiple panes in the same window #825

Merged
merged 41 commits into from
Jun 7, 2019

Conversation

zadjii-msft
Copy link
Member

@zadjii-msft zadjii-msft commented May 15, 2019

image

This is probably good enough to PR, but might not be polished enough to ship quite yet. There's a LOT of work to still do one panes, even after this is checked in. See #1000 for the megathread of all panes related issues.

Things that might need todo's, and what issue they're linked to:

I'm pretty sure most of these don't need to be addressed in the initial PR, and can have follow-up tasks created, but they're all important to note.

This pretty aggressively touches Tab.cpp and App.cpp. App.cpp was doing a lot of work that assumed there was one control per tab. I figured that getting the structure in now would be beneficial, before we add any more code that assumes that.

Closes #532

  * adds two keybindings, Ctrl+Shift++ and Ctrl+Shift+- for horizontal and
    vertical split, respectively.
  * Splits only open the default profile - This should probably be a setting,
    whether to use the default or a new copy of the current pane. There should
    also be a keystroke for opening a pane with a specific profile.
  * Only supports one pane ATM.
  * need to figure out which control is actively focused. Having an IsFocused
    method on the TermControl seems wrong.
  Moving focus between panes is still a janky - selection isn't dismissed when
  the TermControl loses focus, and the cursor remains visible.

  Switching to a tab with panes doesn't focus _any_ control, so that's bad.
  On reload of settings, change the icon of the tab to that of the last focused
  pane
# Conflicts:
#	src/cascadia/TerminalApp/App.cpp
#	src/cascadia/TerminalApp/AppKeyBindings.cpp
#	src/cascadia/TerminalApp/AppKeyBindings.idl
  But something seems fucky with the closing of the tabs. I'm getting crashes,
  when I close with `exit` from the commandline and `closeOnExit:true`, but I
  don't think it has anything to with my change. Gonna mess with master and see
  if it's busted.
…t's probably _more_ wrong."

This reverts commit 23930b5.
@zadjii-msft zadjii-msft added Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Area-User Interface Issues pertaining to the user interface of the Console or Terminal labels May 15, 2019
@zadjii-msft zadjii-msft added this to the Windows Terminal v1.0 milestone May 15, 2019
@mdtauk
Copy link

mdtauk commented May 15, 2019

Will those panes need their own TabView controls?

I am assuming these panes are live consoles, and not just an area to pin/copy output for easy reference, as per #644 which I submitted?

@zadjii-msft
Copy link
Member Author

@mdtauk That's correct, these are full terminal instances.

@DHowett-MSFT and I previously discussed the merits of having top-level tabs and then nested panes vs toplevel panes with nested tabs, and felt that toplevel tabs (similar to tmux) would be the better UX. If each pane had it's own tabview, that would result in a good amount of window real estate being dedicated to just displaying tabs.

This could in the future be used to support pinning content in a new pane. Theoretically you don't even need to limit it to another terminal control in the pane (though this PR is definitely limited to a terminal in the pane). I'll leave that discussion for #644.

@DHowett-MSFT
Copy link
Contributor

Wow! Phone thoughts before reviewing:

Ctrl+Shift+_ looks like a divider... and so does |!

Neither of those characters have a direct VT representation, I believe?

Copy link
Contributor

@DHowett-MSFT DHowett-MSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I'd love to see a design doc on this go into docs/specs; it'll be good to get a quick overview of why it works the way it does.. and also what "the way it does" is.
  • Should SplitVertical/Horizontal be AddSplit(const Pane::SplitState)?

src/cascadia/TerminalApp/App.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/App.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/App.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/CascadiaSettings.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/Pane.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/Tab.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/Tab.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/Tab.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/Tab.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalControl/TermControl.cpp Outdated Show resolved Hide resolved
@miniksa
Copy link
Member

miniksa commented May 16, 2019

Wow! Phone thoughts before reviewing:

Ctrl+Shift+_ looks like a divider... and so does |!

Neither of those characters have a direct VT representation, I believe?

That's super creative and I love it if it doesn't conflict with a VT sequence.

@mdtauk
Copy link

mdtauk commented May 16, 2019

I am assuming there will be keyboard shortcuts for creating these panes. Might I suggest they be added to the Context Menu also.
------------
Split Right
Split Below
------------

# Conflicts:
#	src/cascadia/TerminalApp/App.cpp
#	src/cascadia/TerminalApp/AppKeyBindings.cpp
@zadjii-msft
Copy link
Member Author

My only qualm with | and - as the shortcuts for new panes is that the key for | is a layout-dependent vkey:

https://docs.microsoft.com/en-us/windows/desktop/inputdev/virtual-key-codes

Constant/value Description
VK_OEM_5
0xDC
Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the '|' key

So it'll work great on EN-US, but I don't know about other locales. + didn't have that problem.

I really like that Ctrl+| isn't otherwise a VT sequence though. (Technically ctrl+\ is, but ctrl+shift+\ == ctrl+|). ctrl+- is not a sequence, while ctrl+shift+- == ctrl+_ is.

My thinking with moving to Alt+Shift+plus and Alt+Shift+- (^[+ and ^[_) is to put moving between panes on alt+arrow, and generally putting pane-like operations on alt.

Actually, playing with this more, Ctrl+= and Ctrl+- are both not VT sequences...

doc/cascadia/Panes.md Outdated Show resolved Hide resolved

#pragma once
#include <winrt/Microsoft.Terminal.TerminalControl.h>
#include "../../cascadia/inc/cppwinrt_utils.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alarming

src/cascadia/TerminalApp/Tab.cpp Outdated Show resolved Hide resolved
Don't capture a dead reference

Co-Authored-By: Dustin L. Howett (MSFT) <duhowett@microsoft.com>
Copy link
Member

@miniksa miniksa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

src/cascadia/TerminalApp/Tab.cpp Outdated Show resolved Hide resolved
src/cascadia/TerminalApp/Tab.cpp Outdated Show resolved Hide resolved
Let's try and write code in github
@zadjii-msft zadjii-msft merged commit 2da5b0b into master Jun 7, 2019
@zadjii-msft zadjii-msft deleted the dev/migrie/f/panes branch June 7, 2019 21:56
@zadjii-msft zadjii-msft mentioned this pull request Jun 7, 2019
59 tasks
@Summon528
Copy link
Contributor

You might also want to close #745 and #541

@wclr
Copy link

wclr commented Jul 8, 2019

When this can be expected on Insiders update?

@zadjii-msft
Copy link
Member Author

@whitecolor this is in the version that's currently available on the Store. You need to add splitHorizontal and splitVertical keybindings manually. Note though that panes are super beta and kinda buggy and unpolished ATM.

@wclr
Copy link

wclr commented Jul 8, 2019

@zadjii-msft I tried it so a little buggy but actually may work)

  1. Is it possible to close exiting split pane, is there a command? Ctrl+W closes tab would be better to close the current split.

  2. Is there commands to jump between splits? (Alt +arrow) I think is used often for this.

@zadjii-msft
Copy link
Member Author

@whitecolor Not yet, but most of these are being tracked by #1000

@Weilet
Copy link

Weilet commented Nov 8, 2019

Is there any possibility to custom the style of the splitter?

@zadjii-msft
Copy link
Member Author

@Weilet Not currently. I'll direct your attention to:

And others listed in #1000

@Meir017
Copy link

Meir017 commented Nov 26, 2019

Amazing feature 👍
Is there a plan to add support for typing into multiple panes?

@zadjii-msft
Copy link
Member Author

@Meir017 You're probably looking for "Support broadcast input? #2634"

@Meir017
Copy link

Meir017 commented Nov 26, 2019

@zadjii-msft exactly 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Task It's a feature request, but it doesn't really need a major design.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Split windows