Skip to content

Fixes #4053. v2 WindowsDriver and v2win doesn't show any scenario in the UICatalog with cmd or conhost #4055

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

Merged

Conversation

BDisp
Copy link
Collaborator

@BDisp BDisp commented Apr 25, 2025

Fixes

Proposed Changes/Todos

  • Fixes WindowsDriver
  • Fixes v2win, but still doesn't work using VS2022 debugger and doesn't resize well when the size was changed on another scenario and returning to the main app.

Pull Request checklist:

  • I've named my PR in the form of "Fixes #issue. Terse description."
  • My code follows the style guidelines of Terminal.Gui - if you use Visual Studio, hit CTRL-K-D to automatically reformat your files before committing.
  • My code follows the Terminal.Gui library design guidelines
  • I ran dotnet test before commit
  • I have made corresponding changes to the API documentation (using /// style comments)
  • My changes generate no new warnings
  • I have checked my code and corrected any poor grammar or misspellings
  • I conducted basic QA to assure all features are working

@BDisp BDisp requested a review from tig as a code owner April 25, 2025 22:12
@BDisp BDisp marked this pull request as draft April 25, 2025 22:13
@BDisp BDisp marked this pull request as ready for review April 26, 2025 14:58
@BDisp
Copy link
Collaborator Author

BDisp commented Apr 26, 2025

This is ready for review. Thanks.

@tig tig requested a review from Copilot May 9, 2025 14:45
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request addresses issue #4053 by updating the WindowsDriver and v2win components so that scenarios display correctly in the UICatalog when using cmd or conhost. Key changes include enabling the HACK_CHECK_WINCHANGED define flag in multiple modules, refining the WindowsTerminal detection and handling logic, and updating the Force16Colors property in the V2 driver.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Terminal.Gui/ConsoleDrivers/WindowsDriver/WindowsMainLoop.cs Added a define for HACK_CHECK_WINCHANGED to assist with window size changes.
Terminal.Gui/ConsoleDrivers/WindowsDriver/WindowsDriver.cs Re-enabled HACK_CHECK_WINCHANGED and moved WindowsTerminal detection into a conditional block.
Terminal.Gui/ConsoleDrivers/WindowsDriver/WindowsConsole.cs Updated usage of _screenBuffer and IsWindowsTerminal in various console operations.
Terminal.Gui/ConsoleDrivers/V2/WindowsOutput.cs Adjusted Write method to account for Force16Colors in cursor visibility.
Terminal.Gui/ConsoleDrivers/V2/MainLoopCoordinator.cs Introduced _isWindowsTerminal field based on environment variables.
Terminal.Gui/ConsoleDrivers/V2/ConsoleDriverFacade.cs Modified Force16Colors property to reflect true color support.
Comments suppressed due to low confidence (1)

Terminal.Gui/ConsoleDrivers/WindowsDriver/WindowsConsole.cs:147

  • [nitpick] Consider removing or archiving the commented-out code blocks (e.g., around screen buffer initialization) if they are no longer needed to improve code clarity.
//if (_screenBuffer == nint.Zero)

@tig tig merged commit f98e460 into gui-cs:v2_develop May 9, 2025
11 checks passed
@BDisp BDisp deleted the v2_4053_windowsdriver-v2win-cleanup-fix branch May 9, 2025 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v2 WindowsDriver and v2win doesn't show any scenario in the UICatalog with cmd or conhost
2 participants