Fix behavior of split-pane for existing windows (#19347)

Closes #18815

## Validation Steps Performed
* `wt -w 0 sp` splits the current tab 
This commit is contained in:
Leonard Hecker 2025-09-16 20:09:56 +02:00 committed by GitHub
parent 814f78ed2c
commit 0aee174e68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions

View File

@ -44,10 +44,6 @@ namespace winrt::TerminalApp::implementation
{ {
_args = { value.begin(), value.end() }; _args = { value.begin(), value.end() };
_parseResult = _parsed.ParseArgs(_args); _parseResult = _parsed.ParseArgs(_args);
if (_parseResult == 0)
{
_parsed.ValidateStartupCommands();
}
} }
winrt::com_array<winrt::hstring> CommandlineArgs::Commandline() winrt::com_array<winrt::hstring> CommandlineArgs::Commandline()

View File

@ -1050,6 +1050,11 @@ namespace winrt::TerminalApp::implementation
// (or called TerminalWindow::Initialize) // (or called TerminalWindow::Initialize)
if (_appArgs->ExitCode() == 0) if (_appArgs->ExitCode() == 0)
{ {
// The existing logic (before this commit) strictly relied on
// ValidateStartupCommands() only to be called for new windows.
// It modifies the actions it stores.
parsedArgs.ValidateStartupCommands();
// If the size of the arguments list is 1, // If the size of the arguments list is 1,
// then it contains only the executable name and no other arguments. // then it contains only the executable name and no other arguments.
_hasCommandLineArguments = _appArgs->CommandlineRef().size() > 1; _hasCommandLineArguments = _appArgs->CommandlineRef().size() > 1;