Repository: microsoft/terminal
File: src/cascadia/TerminalApp/TabManagement.cpp (C++)

Code before:
                _CreateNewTabFromSettings(profileGuid.value(), settingsCreateResult);

                const auto runtimeTabText{ tab.GetTabText() };
                if (!runtimeTabText.empty())
                {
                    if (auto newTab{ _GetFocusedTabImpl() })
                    {
                        newTab->SetTabText(runtimeTabText);
                    }
                }
            }
        }
        CATCH_LOG();
    }

    // Method Description:
    // - Sets the specified tab as the focused tab and splits its active pane
    // Arguments:
    // - tab: tab to split
    void TerminalPage::_SplitTab(TerminalTab& tab)
    {
        try
        {
            _SetFocusedTab(tab);
            NewTerminalArgs newTerminalArgs{};
            _SplitPaneAnyTab(tab, SplitState::Automatic, SplitType::Duplicate, 0.5f, newTerminalArgs);
        }
        CATCH_LOG();
    }

    // Method Description:
    // - Removes the tab (both TerminalControl and XAML) after prompting for approval
    // Arguments:
    // - tab: the tab to remove
    winrt::Windows::Foundation::IAsyncAction TerminalPage::_HandleCloseTabRequested(winrt::TerminalApp::TabBase tab)
    {
        if (tab.ReadOnly())
        {
            ContentDialogResult warningResult = co_await _ShowCloseReadOnlyDialog();

            // If the user didn't explicitly click on close tab - leave
            if (warningResult != ContentDialogResult::Primary)
            {
                co_return;
            }
        }
        _RemoveTab(tab);
    }

    // Method Description:
    // - Removes the tab (both TerminalControl and XAML)

Review comment (refactor):
Looks like `_SplitPaneAnyTab()` has a default value for `newTerminalArgs` already. So you should be able to just take advantage of that for the last two params. (I love default params!!!!)

```suggestion
            _SplitPaneAnyTab(tab, SplitState::Automatic, SplitType::Duplicate);
```

Code after:
                _CreateNewTabFromSettings(profileGuid.value(), settingsCreateResult);

                const auto runtimeTabText{ tab.GetTabText() };
                if (!runtimeTabText.empty())
                {
                    if (auto newTab{ _GetFocusedTabImpl() })
                    {
                        newTab->SetTabText(runtimeTabText);
                    }
                }
            }
        }
        CATCH_LOG();
    }

    // Method Description:
    // - Sets the specified tab as the focused tab and splits its active pane
    // Arguments:
    // - tab: tab to split
    void TerminalPage::_SplitTab(TerminalTab& tab)
    {
        try
        {
            _SetFocusedTab(tab);
            _SplitPane(tab, SplitState::Automatic, SplitType::Duplicate);
        }
        CATCH_LOG();
    }

    // Method Description:
    // - Removes the tab (both TerminalControl and XAML) after prompting for approval
    // Arguments:
    // - tab: the tab to remove
    winrt::Windows::Foundation::IAsyncAction TerminalPage::_HandleCloseTabRequested(winrt::TerminalApp::TabBase tab)
    {
        if (tab.ReadOnly())
        {
            ContentDialogResult warningResult = co_await _ShowCloseReadOnlyDialog();

            // If the user didn't explicitly click on close tab - leave
            if (warningResult != ContentDialogResult::Primary)
            {
                co_return;
            }
        }
        _RemoveTab(tab);
    }

    // Method Description:
    // - Removes the tab (both TerminalControl and XAML)
    // Arguments: