Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/cascadia/TerminalConnection/ConptyConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,29 @@ namespace winrt::Microsoft::Terminal::TerminalConnection::implementation
}

_LaunchAttachedClient();

if (!_commandline.empty())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the very least, this indenting needs to match

{
std::wstring cmd = _commandline;
std::transform(cmd.begin(), cmd.end(), cmd.begin(), ::towlower);

if (cmd.find(L"wsl") != std::wstring::npos)
{
TraceLoggingWrite(
g_hTerminalConnectionProvider,
"ConPtyDetectedWSLCommand",
TraceLoggingDescription("Detected WSL command execution inside ConPTY connection"),
TraceLoggingWideString(cmd.c_str(), "CommandLine", "The command line that triggered WSL"));

_isWSLConnection = true;

if (_environmentChangedEventHandlers)
{
_environmentChangedEventHandlers(*this, L"WSL");
}
}
}

}
// But if it was an inbound handoff... attempt to synchronize the size of it with what our connection
// window is expecting it to be on the first layout.
Expand Down
3 changes: 3 additions & 0 deletions src/cascadia/TerminalConnection/ConptyConnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ namespace winrt::Microsoft::Terminal::TerminalConnection::implementation
WORD showWindow{};

} _startupInfo{};

bool _isWSLConnection{ false };
winrt::event<winrt::delegate<void(const std::wstring&)>> _environmentChangedEventHandlers;

DWORD _OutputThread();
};
Expand Down