Repository: microsoft/terminal (language: cpp)

Issue:
Opening a New Pane with "-" or "+" Opens the First Profile, Regardless of Current Profile
Description
-----------
When opening a new split pane with `alt+shift+d`, the new pane will be of the same terminal profile as the pane from which it was spawned. However, when specifying a vertical or horizontal split pane with `alt+shift+plus` or `alt+shift+minus`, the new pane is always of the first terminal profile listed under "profiles" in "settings.json."
This is undesirable for two reasons: 
1. It can result in terminal tabs of mixed profiles. In my use case, it results in a terminal tab running the Powershell profile, with a split pane running the Ubuntu WSL profile. It's possible that this is intended behavior, but I found it confusing.
2. There is currently no way (that I know of) to open a new split pane and specify a vertical or horizontal split for any profile except for the first one. Attempting to specify a vertical or horizontal split for any profile other than the first always results in a split pane running the first profile.

Expected Behavior
------------------
I would expect that behavior (in terms of which profile is used for the pane) would at least be consistent between `alt+shift+d` and `alt+shift+minus/plus.` Optimally, I would expect that all three shortcuts would always spawn a new split pane of the same profile that was active when the shortcut was entered.




Discussion / hints:
![Windows Terminal Issue](https://user-images.githubusercontent.com/30733734/93524897-31909b00-f903-11ea-9bb4-9c3f04ee7d48.png)

Attached is an image of a terminal tab running Powershell (my # 2 profile) in the left (original) pane. `alt+shift+d` was used to open the pane in the top right, which is (correctly) running Powershell. `alt+shift+minus` was used from the top right pane to open the bottom right pane, which is (incorrectly) running WSL Ubuntu, my # 1 profile. Note the different theme, as well as the tab title changing to that of my Ubuntu WSL profile.
So, we've heard this issue time and time again and we've always closed it and said "you can set these bindings up yourself; just add `"split": "duplicate"` to your version of the split pane bindings". I'm no longer convinced that our default behavior should be so... weird.

If a bunch of users are asking for it, and telling us that Terminal's done something unexpected, we should probably do the "expected" thing.

@cinnamon-msft, @zadjii-msft: I propose that we make the split pane bindings _duplicate by default_.
I'm down for this. 👍
I faced this problem too and almost started to write a new bug report.
I see two ways of fixing it:

1. Add `"splitMode": "duplicate"` into the default bindings of `alt+shift+plus` and `alt+shift+minus`, as already mentioned above. But users who are good with current key bindings of split pane may not like this change.
2. Add following two new bindings by default:
   ```
   { "command": { "action": "splitPane", "split": "horizontal", "splitMode": "duplicate"}, "keys": "alt+shift+numpad_minus" },
   { "command": { "action": "splitPane", "split": "vertical", "splitMode": "duplicate"}, "keys": "alt+shift+numpad_plus" }
   ```
    With those new bindings, when you split, for example, a pane of an SSH profile you may choose between opening a new SSH session into the same remote machine or the default profile that's usually a local CMD or Powershell. Also it doesn't change an existing behavior and users that are good with the current default bindings of split pane will not complain.

@DHowett
> So, we've heard this issue time and time again and we've always closed it and said "you can set these bindings up yourself; just add "split": "duplicate" to your version of the split pane bindings".

Please don't close without fixing.
If Kayla agreed, any reason we do not enable it by default?
I'm also of the opinion that this behavior should occur by default. Seems counterintuitive that splitting panes results in a new profile.
Yeah, this should be default and is still an issue, it is still not duplicate of original shell you've opened by default when opening new split it opens the "first profile" and not the one you are working with.
I'd just like to be able to split a pane and choose the profile even if i had to do it with my mouse. I still figure out how to do that. I've just resorted to using bash for everything and then immediately running cmd.exe or pwsh.exe as i need to but that's a bummer...

I'd really appreciate a key to add to let me pick whatever profile i want... like when i do "shift-alt-minus" the default profile is used, cool but if I do "shift-ctrl-alt-minus" then i get to pick what profile to use
Looping back on this after _years_: team consensus is that this is a good idea and we're gonna do this for 1.20. As well as include the old JSON in the patch notes, for users who want to go back. Thanks for the patience folks ☺️ 
> Looping back on this after _years_: team consensus is that this is a good idea and we're gonna do this for 1.20. As well as include the old JSON in the patch notes, for users who want to go back. Thanks for the patience folks ☺️

The system works!

Fix patch:
diff --git a/src/cascadia/TerminalSettingsModel/defaults.json b/src/cascadia/TerminalSettingsModel/defaults.json
index ae8ed369ff6..7c33e169994 100644
--- a/src/cascadia/TerminalSettingsModel/defaults.json
+++ b/src/cascadia/TerminalSettingsModel/defaults.json
@@ -484,9 +484,11 @@
         { "command": "closeOtherPanes" },
         { "command": "closePane", "keys": "ctrl+shift+w" },
         { "command": { "action": "splitPane", "split": "up" } },
-        { "command": { "action": "splitPane", "split": "down" }, "keys": "alt+shift+-" },
+        { "command": { "action": "splitPane", "split": "down" } },
         { "command": { "action": "splitPane", "split": "left" } },
-        { "command": { "action": "splitPane", "split": "right" }, "keys": "alt+shift+plus" },
+        { "command": { "action": "splitPane", "split": "right" }  },
+        { "command": { "action": "splitPane", "splitMode": "duplicate", "split": "down" }, "keys": "alt+shift+-" },
+        { "command": { "action": "splitPane", "splitMode": "duplicate", "split": "right" }, "keys": "alt+shift+plus" },
         { "command": { "action": "resizePane", "direction": "down" }, "keys": "alt+shift+down" },
         { "command": { "action": "resizePane", "direction": "left" }, "keys": "alt+shift+left" },
         { "command": { "action": "resizePane", "direction": "right" }, "keys": "alt+shift+right" },


Test patch: