File tree Expand file tree Collapse file tree 3 files changed +28
-4
lines changed Expand file tree Collapse file tree 3 files changed +28
-4
lines changed Original file line number Diff line number Diff line change @@ -279,15 +279,25 @@ namespace winrt::TerminalApp::implementation
279
279
return ;
280
280
}
281
281
282
- const auto & duplicateFromTab{ realArgs.SplitMode () == SplitType::Duplicate ? _GetFocusedTab () : nullptr };
283
-
284
282
const auto & terminalTab{ _senderOrFocusedTab (sender) };
285
-
286
- _SplitPane (terminalTab,
283
+ const auto & duplicateFromTab { realArgs.SplitMode () == SplitType::Duplicate ? _GetFocusedTab () : nullptr };
284
+ // The tab is not focused yet if we just created the tab, hacky workaround want to get feedback on if ive missed a edge cas ebefore cleaning up
285
+ if (!duplicateFromTab && terminalTab.get ())
286
+ {
287
+ _SplitPane (terminalTab,
288
+ realArgs.SplitDirection (),
289
+ // This is safe, we're already filtering so the value is (0, 1)
290
+ realArgs.SplitSize (),
291
+ _MakePane (realArgs.ContentArgs (), *terminalTab.get ()));
292
+ }
293
+ else
294
+ {
295
+ _SplitPane (terminalTab,
287
296
realArgs.SplitDirection (),
288
297
// This is safe, we're already filtering so the value is (0, 1)
289
298
realArgs.SplitSize (),
290
299
_MakePane (realArgs.ContentArgs (), duplicateFromTab));
300
+ }
291
301
args.Handled (true );
292
302
}
293
303
}
Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ namespace winrt::TerminalApp::implementation
89
89
90
90
// This call to _MakePane won't return nullptr, we already checked that
91
91
// case above with the _maybeElevate call.
92
+ // _MakePane
92
93
_CreateNewTabFromPane (_MakePane (newContentArgs, nullptr ));
93
94
return S_OK;
94
95
}
Original file line number Diff line number Diff line change @@ -3285,6 +3285,19 @@ namespace winrt::TerminalApp::implementation
3285
3285
{
3286
3286
controlSettings.DefaultSettings ().StartingDirectory (workingDirectory);
3287
3287
}
3288
+ // Copy Title and Color of tab you split
3289
+ controlSettings.DefaultSettings ().StartingTitle (terminalTab->Title ());
3290
+ const auto color = terminalTab->GetTabColor ();
3291
+ if (color.has_value ())
3292
+ {
3293
+ const auto & rawColor = color.value ();
3294
+ controlSettings.DefaultSettings ().StartingTabColor (
3295
+ winrt::Microsoft::Terminal::Core::Color{
3296
+ rawColor.R ,
3297
+ rawColor.G ,
3298
+ rawColor.B ,
3299
+ rawColor.A });
3300
+ }
3288
3301
}
3289
3302
}
3290
3303
if (!profile)
You can’t perform that action at this time.
0 commit comments