Conversation
…Capabilities Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/f93a30b7-6649-4c5a-95bd-014fb4f1eb2a Co-authored-by: tig <585482+tig@users.noreply.github.com>
Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/f93a30b7-6649-4c5a-95bd-014fb4f1eb2a Co-authored-by: tig <585482+tig@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Remove IDriver.GetVersionInfo and add IDriver.KittyKeyboardCapabilities
Fixes #3999. Remove IDriver.GetVersionInfo, add IDriver.KittyKeyboardCapabilities
Apr 10, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the driver abstraction by removing IDriver.GetVersionInfo() and exposing kitty keyboard protocol detection results as a first-class IDriver.KittyKeyboardCapabilities property, eliminating the need for callers to reach into DriverImpl internals.
Changes:
- Removed
IDriver.GetVersionInfo()and updated the UICatalog status display to useGetName()instead. - Renamed
KittyKeyboardProtocolResulttoKittyKeyboardCapabilitiesand updated kitty keyboard detection plumbing to store capabilities on the driver. - Updated callers/tests to use the renamed type and the new
IDriverproperty.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/UnitTestsParallelizable/Drivers/AnsiHandling/KittyKeyboardProtocolDetectorTests.cs | Updates tests to use KittyKeyboardCapabilities naming. |
| Tests/UnitTestsParallelizable/Application/MainLoopCoordinatorTests.cs | Updates assertions to use driver.KittyKeyboardCapabilities. |
| Terminal.Gui/Drivers/IDriver.cs | Removes GetVersionInfo() and adds KittyKeyboardCapabilities to the public interface. |
| Terminal.Gui/Drivers/DriverImpl.cs | Removes GetVersionInfo() implementation and stores detected kitty keyboard capabilities. |
| Terminal.Gui/Drivers/AnsiHandling/KittyKeyboardProtocolDetector.cs | Renames detection result type usage to KittyKeyboardCapabilities. |
| Terminal.Gui/Drivers/AnsiHandling/KittyKeyboardCapabilities.cs | Renames the capabilities/result type and updates XML docs. |
| Terminal.Gui/App/MainLoop/MainLoopCoordinator.cs | Stores detected kitty keyboard capabilities via the new setter. |
| Examples/UICatalog/UICatalogRunnable.cs | Replaces GetVersionInfo() with GetName() for display. |
Comments suppressed due to low confidence (1)
Terminal.Gui/Drivers/AnsiHandling/KittyKeyboardCapabilities.cs:22
- KittyKeyboardCapabilities is now exposed via the public IDriver API, but its properties have public setters. This allows any consumer to mutate IsSupported/SupportedFlags/EnabledFlags and potentially put the driver into an invalid state. Consider making the type immutable (get/init-only) or restricting setters (e.g., internal/private set) and updating internal code accordingly.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…bil' of tig:gui-cs/Terminal.Gui into copilot/remove-get-version-info-add-kitty-keyboard-capabil
Centralize Kitty keyboard enable/disable logic in KittyKeyboardProtocolDetector, removing it from AnsiOutput. Simplify KittyKeyboardCapabilities by replacing SupportedFlags and EnabledFlags with a single Flags property. Update MainLoopCoordinator and driver to use the new API, and make KittyKeyboardCapabilities settable on IDriver. Update all usages and tests to use the new Flags property. Remove obsolete code and tests from AnsiOutput. Improve logging and tracing for Kitty protocol detection and driver initialization. Update Keys scenario and UICatalogRunnable to display Kitty protocol status using the new approach.
Enhances driver and main loop to reliably enable kitty keyboard mode on startup (with post-enable detection of actual flags) and disable it on shutdown before disposing output. Updates KittyKeyboardProtocolDetector to confirm and store enabled flags. Reduces debug output by commenting trace lines. Updates docs to clarify negotiation and shutdown flow. Adds/updates tests to verify enable/disable sequences and capability updates.
…-keyboard-capabil
Added a new test region to KittyKeyboardPipelineTests to ensure no duplicate KeyDown events are raised when both Kitty CSI-u sequences and legacy printable characters are received for the same keypress. Tests cover generic printable keys, Portuguese keyboard characters, and Kitty sequences with associated text, addressing terminal behaviors that emit both input types.
…nput Added suppression logic in AnsiInputProcessor to prevent duplicate keydown events when both Kitty CSI-u and legacy printable sequences are received for the same key. Introduced virtual methods in InputProcessorImpl for customizable suppression. Updated related tests for style consistency.
10 tasks
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…r.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ity to DriverImpl.SetKittyKeyboardCapabilities Agent-Logs-Url: https://github.com/gui-cs/Terminal.Gui/sessions/3b2bd475-1a29-40c5-877b-3b81ae948a10 Co-authored-by: tig <585482+tig@users.noreply.github.com>
…bil' of tig:gui-cs/Terminal.Gui into copilot/remove-get-version-info-add-kitty-keyboard-capabil
BDisp
approved these changes
Apr 11, 2026
Collaborator
BDisp
left a comment
There was a problem hiding this comment.
Well planned and implemented. Converting isolated characters to a CSI-u sequence on the keydown event is a truly elegant solution. Thanks.
This was referenced May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes
IDriver.GetVersionInfo()(redundant withGetName()) and promotes kitty keyboard protocol state to a first-classIDriverproperty, eliminating the need for callers to cast toDriverImpl.Proposed Changes/Todos
GetVersionInfo()fromIDriverandDriverImpl; updateUICatalogRunnableto callGetName()directly with a null-safe fallbackKittyKeyboardProtocolResult→KittyKeyboardCapabilities(file rename + class rename, updated XML docs)KittyKeyboardCapabilities? KittyKeyboardCapabilities { get; }(get-only) toIDriver, following the same pattern asColorCapabilitiesDriverImplimplements the property as{ get; private set; }with aninternal void SetKittyKeyboardCapabilities()method — onlyMainLoopCoordinator(which holds a concreteDriverImpl) can update it, keeping capability detection authoritativeKittyKeyboardProtocolDetector.Detect()no longer directly assigns driver state — the detector only detects and invokes the callbackMainLoopCoordinatorcalls_driver?.SetKittyKeyboardCapabilities(result)when detection confirms supportKittyKeyboardCapabilitiestype anddriver.KittyKeyboardCapabilitiesproperty;Assert.NotNulladded before accessing members to strengthen assertionsPull Request checklist:
CTRL-K-Dto automatically reformat your files before committing.dotnet testbefore commit///style comments)