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

Modernize VtPipeTerm #17647

Merged
merged 10 commits into from
Aug 26, 2024
Merged

Modernize VtPipeTerm #17647

merged 10 commits into from
Aug 26, 2024

Conversation

lhecker
Copy link
Member

@lhecker lhecker commented Aug 2, 2024

This shortens VtPipeTerm quite a bit, which used to have various debug
flags and modes. I kept the --out flag to redirect the output to a
file, but I removed the --debug (pipe the output through WSL and
show escape sequences visually) and --headless (hide conpty) flags.

I did this, because VtPipeTerm always used the system ConPTY API
but I needed it to use my local OpenConsole. I also wanted it to
use overlapped IO for testing but found that it was too difficult
to refactor make that work.

I also noticed that the project was the only holdout for
conpty.h which had to be kept in sync with winconpty.h.

@lhecker lhecker added the Area-CodeHealth Issues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc. label Aug 2, 2024
}
BOOL WINAPI ReadConsoleInputExA(
_In_ HANDLE hConsoleInput,
_Out_writes_(nLength) PINPUT_RECORD lpBuffer,

Check failure

Code scanning / check-spelling

Unrecognized Spelling

[PINPUT](#security-tab) is not a recognized word. \(unrecognized-spelling\)
src/tools/vtpipeterm/main.cpp Fixed Show fixed Hide fixed

This comment has been minimized.

</ItemGroup>
<ItemGroup>
<ClCompile Include="main.cpp" />
<ClCompile Include="VtConsole.cpp" />
Copy link
Member

Choose a reason for hiding this comment

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

if i recall, this builds in Windows too. Can you update sources?

unsigned short width = srViewport.Right - srViewport.Left + 1;
unsigned short height = srViewport.Bottom - srViewport.Top + 1;
HPCON hPC = nullptr;
THROW_IF_FAILED(ConptyCreatePseudoConsole(viewportSize, pipe.client.get(), pipe.client.get(), 0, &hPC));
Copy link
Member

Choose a reason for hiding this comment

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

Ah, it's a duplex pipe. Clever.

@@ -1,16 +0,0 @@
// Copyright (c) Microsoft Corporation.
Copy link
Member

Choose a reason for hiding this comment

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

we could keep this, it is OK

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, I forgot about this comment.

I initially thought this was a leftover file for translatable strings, but now I realize that this is for the .exe information. Hmmm, I think it's fine to remove in that case, since despite this tool being part of the OS repo, I'm not sure it's used by anyone there anyway.

@lhecker lhecker merged commit 760daa6 into main Aug 26, 2024
20 checks passed
@lhecker lhecker deleted the dev/lhecker/VtPipeTerm branch August 26, 2024 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-CodeHealth Issues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants