Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ITerminalHandoff3 in preparation for overlapped pipes #17575

Merged
merged 4 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
13 changes: 3 additions & 10 deletions src/cascadia/TerminalConnection/ConptyConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,21 +482,14 @@ namespace winrt::Microsoft::Terminal::TerminalConnection::implementation
void ConptyConnection::_LastConPtyClientDisconnected() noexcept
try
{
DWORD exitCode = 0;
DWORD exitCode{ 0 };
GetExitCodeProcess(_piClient.hProcess, &exitCode);

// Signal the closing or failure of the process.
// exitCode might be STILL_ACTIVE if a client has called FreeConsole() and
// thus caused the tab to close, even though the CLI app is still running.
const auto success = exitCode == 0 || exitCode == STILL_ACTIVE || exitCode == STATUS_CONTROL_C_EXIT;
Copy link
Member

Choose a reason for hiding this comment

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

honestly I was actually fine w/ this change - I just thought the exitcode one was weird! sorry!!

Copy link
Member Author

Choose a reason for hiding this comment

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

Nah, we can do such changes later, when they're necessary. 🙂

const auto state = success ? ConnectionState::Closed : ConnectionState::Failed;

if (!success)
{
_indicateExitWithStatus(exitCode);
}

_transitionToState(state);
_transitionToState(exitCode == 0 || exitCode == STILL_ACTIVE ? ConnectionState::Closed : ConnectionState::Failed);
_indicateExitWithStatus(exitCode);
}
CATCH_LOG()

Expand Down
2 changes: 1 addition & 1 deletion src/host/srvinit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ try

// GH#13211 - Make sure the terminal obeys the resizing quirk. Otherwise,
// defterm connections to the Terminal are going to have weird resizing.
const auto commandLine = fmt::format(FMT_COMPILE(L" --headless --signal {:#x}"),
const auto commandLine = fmt::format(FMT_COMPILE(L" --headless --resizeQuirk --signal {:#x}"),
(int64_t)signalPipeOurSide.release());

ConsoleArguments consoleArgs(commandLine, inPipeOurSide.release(), outPipeOurSide.release());
Expand Down
Loading