Unify pane splitting and new tab creation #14950

Open
opened 2026-01-31 04:24:02 +00:00 by claunia · 0 comments
Owner

Originally created by @DHowett on GitHub (Aug 23, 2021).

In my eyes, spawning a new tab is a special case of splitting a nonexistent window into one pane.

Right now, we have a lot of divergence between opening a tab (1) and opening a pane (2); in both cases we spawn a new control, but the way it gets propagated into the tree is vastly different. The same applies for duplicating an active pane; the code in pane splitting suggests that duplicating a pane keeps the working directory but a tab does not (!) (see 3) EDIT: No, we accounted for it. Double the code, double the places to look 😉

1

10992b77a0/src/cascadia/TerminalApp/TabManagement.cpp (L242-L272)

2

10992b77a0/src/cascadia/TerminalApp/TerminalPage.cpp (L1391-L1416)

Collapsed note 3

3

10992b77a0/src/cascadia/TerminalApp/TerminalPage.cpp (L1359-L1370)

Originally created by @DHowett on GitHub (Aug 23, 2021). In my eyes, spawning a new tab is a special case of splitting a nonexistent window into one pane. Right now, we have a lot of divergence between opening a tab (1) and opening a pane (2); in both cases we spawn a new control, but the way it gets propagated into the tree is vastly different. The same applies for duplicating an active pane; ~the code in pane splitting suggests that duplicating a pane keeps the working directory but a tab does not (!) (see 3)~ EDIT: No, we accounted for it. Double the code, double the places to look 😉 ### 1 https://github.com/microsoft/terminal/blob/10992b77a0aafdaf1166493df3d0c044bf8975ea/src/cascadia/TerminalApp/TabManagement.cpp#L242-L272 ### 2 https://github.com/microsoft/terminal/blob/10992b77a0aafdaf1166493df3d0c044bf8975ea/src/cascadia/TerminalApp/TerminalPage.cpp#L1391-L1416 <details> <summary>Collapsed note 3</summary> ### 3 https://github.com/microsoft/terminal/blob/10992b77a0aafdaf1166493df3d0c044bf8975ea/src/cascadia/TerminalApp/TerminalPage.cpp#L1359-L1370 </details>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#14950