Replace duplicateTab with newTab with arg #13632

Open
opened 2026-01-31 03:47:51 +00:00 by claunia · 6 comments
Owner

Originally created by @carlos-zamora on GitHub (Apr 26, 2021).

Originally assigned to: @carlos-zamora on GitHub.

Description of the new feature/enhancement

duplicateTab and newTab are two different actions whereas splitPane accomplishes the functionality of both "duplicate my current pane" and "open a new pane". splitPane also lets the user use NewTerminalArgs to customize a duplicate pane.

I propose we do one of the following:

  1. Deprecate duplicateTab:
    • add a mode arg to newTab. Possible values include duplicateProfile and duplicatePaneStructure (see #4674). Default value is null.
    • duplicateTab still exists, but is just an alias for newTab with mode=duplicateProfile.
    • This gives us NewTerminalArgs for free and creates a consistent design across actions creating new panes and new tabs.
  2. Split splitPane into splitPane and duplicatePane:
    • duplicatePane would have 2 args: size and split (same behavior as from splitPane)
    • This provides a consistent design, but I feel that it doesn't provide adequate NewTerminalArgs benefits.

Other comments

Inspired by a comment made by @lhecker
#4674 Should be kept in mind with the new design.
I'm open to other ideas or different names for these actions/args.

Resources

duplicateTab docs
newTab docs
splitPane docs

Originally created by @carlos-zamora on GitHub (Apr 26, 2021). Originally assigned to: @carlos-zamora on GitHub. # Description of the new feature/enhancement `duplicateTab` and `newTab` are two different actions whereas `splitPane` accomplishes the functionality of both "duplicate my current pane" and "open a new pane". `splitPane` also lets the user use `NewTerminalArgs` to customize a duplicate pane. I propose we do one of the following: 1. Deprecate `duplicateTab`: - add a `mode` arg to `newTab`. Possible values include `duplicateProfile` and `duplicatePaneStructure` (see #4674). Default value is `null`. - `duplicateTab` still exists, but is just an alias for `newTab` with `mode=duplicateProfile`. - This gives us `NewTerminalArgs` for free and creates a consistent design across actions creating new panes and new tabs. 2. Split `splitPane` into `splitPane` and `duplicatePane`: - `duplicatePane` would have 2 args: `size` and `split` (same behavior as from `splitPane`) - This provides a consistent design, but I feel that it doesn't provide adequate `NewTerminalArgs` benefits. ### Other comments _Inspired by a comment made by @lhecker_ #4674 Should be kept in mind with the new design. I'm open to other ideas or different names for these actions/args. # Resources [`duplicateTab` docs](https://docs.microsoft.com/en-us/windows/terminal/customize-settings/actions#duplicate-tab) [`newTab` docs](https://docs.microsoft.com/en-us/windows/terminal/customize-settings/actions#new-tab) [`splitPane` docs](https://docs.microsoft.com/en-us/windows/terminal/customize-settings/actions#split-a-pane)
claunia added the Area-SettingsIssue-TaskProduct-Terminal labels 2026-01-31 03:47:51 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Apr 26, 2021):

gods I hate this. I already deeply regret making "duplicate pane" an argument to splitPane instead of a separate action. I'm not sure there's anyone using "duplicate pane, but also I want x, y, and z to actually have the values foo, bar, baz". It means that there's this long, verbose action just for duplicate pane, and that's annoying. duplicatePane would have just been easier. Maybe I was just high on adding args to everything because we could. I never considered if we should 😆

I'd definitely prefer the second option, the "make a duplicatePane action" route. We can still throw args in duplicateTab for "duplicatePaneStructure: bool".

@zadjii-msft commented on GitHub (Apr 26, 2021): gods I hate this. I already deeply regret making "duplicate pane" an argument to `splitPane` instead of a separate action. I'm not sure there's anyone using "duplicate pane, but also I want `x`, `y`, and `z` to actually have the values foo, bar, baz". It means that there's this long, verbose action just for duplicate pane, and that's annoying. `duplicatePane` would have just been easier. Maybe I was just high on adding args to everything because we _could_. I never considered if we _should_ 😆 I'd definitely prefer the second option, the "make a `duplicatePane` action" route. We can still throw args in `duplicateTab` for "duplicatePaneStructure: bool".
Author
Owner

@DHowett commented on GitHub (Apr 26, 2021):

Maybe I was just high on adding args to everything because we could. I never considered if we should 😆

And the pendulum swings. 😄

@DHowett commented on GitHub (Apr 26, 2021): > Maybe I was just high on adding args to everything because we _could_. I never considered if we _should_ 😆 And the pendulum swings. :smile:
Author
Owner

@zadjii-msft commented on GitHub (Apr 29, 2021):

Option 2 sounds cool

@zadjii-msft commented on GitHub (Apr 29, 2021): Option 2 sounds cool
Author
Owner

@carlos-zamora commented on GitHub (Nov 7, 2022):

We've decided on option 1. Mainly because of #10232, #12985, and #14350.

We need to add duplicate: {true|false} to NewTerminalArgs, and make sure that new tab, new window code knows how to handle this.

We can promote that to an enum when we get to #4674.

@carlos-zamora commented on GitHub (Nov 7, 2022): We've decided on option 1. Mainly because of #10232, #12985, and #14350. We need to add `duplicate: {true|false}` to NewTerminalArgs, and make sure that new tab, new window code knows how to handle this. We can promote that to an enum when we get to #4674.
Author
Owner

@Aymkdn commented on GitHub (Jan 3, 2023):

Will this change permit to set the default behavior of the "new" button as a duplicate/clone of the current tab?
image

So when clicking on "new", we could duplicate the current tab instead of using the "Duplicate" menu?
image

@Aymkdn commented on GitHub (Jan 3, 2023): Will this change permit to set the default behavior of the "new" button as a duplicate/clone of the current tab? ![image](https://user-images.githubusercontent.com/946315/210413077-55ff631f-104a-4ed6-bad5-417ed841320a.png) So when clicking on "new", we could duplicate the current tab instead of using the "Duplicate" menu? ![image](https://user-images.githubusercontent.com/946315/210413411-ab75b371-3ac5-420d-8dd4-fbba19fa1f8f.png)
Author
Owner

@zadjii-msft commented on GitHub (Jan 3, 2023):

@Aymkdn This by itself - no. That we're tracking in #445.

@zadjii-msft commented on GitHub (Jan 3, 2023): @Aymkdn This by itself - no. That we're tracking in #445.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#13632