Updated the `.NET Core` badge to reference the `v2_develop` branch.
Revised the `codecov` badge to remove branch-specific paths and
added a token parameter. Adjusted badge placement for better
alignment and included additional badges for `Downloads`,
`License`, and `Bugs`.
* Refactor newinv2.md deep dive doc
Terminal.Gui v2 introduces a transformative redesign, simplifying the library's architecture and improving maintainability. Key changes include:
- Added TrueColor support with 24-bit RGB handling.
- Introduced `Adornment` framework for borders, padding, and margins.
- Enhanced Unicode and wide character support for internationalization.
- Added `LineCanvas` for drawing lines and shapes with box-drawing characters.
- Simplified API by consolidating redundant methods and aligning with modern .NET standards.
- Introduced `ConfigurationManager` for user-customizable themes and text styles.
- Improved scrolling with `Viewport` and integrated `ScrollBar`.
- Added new layout features like `Dim.Auto`, `Pos.AnchorEnd`, and `Pos.Align`.
- Overhauled keyboard and mouse APIs for better input handling.
- Introduced new views (e.g., `DatePicker`, `ColorPicker`, `GraphView`) and enhanced existing ones.
- Added Sixel image support for rendering graphics in compatible terminals.
- Ensured AOT compatibility for improved deployment and performance.
This update lays the foundation for building modern, user-friendly terminal applications.
* Fixes#4368 - Clarify and Fix CWPPropertyHelper Property Change Workflow
Refactor ChangeProperty method for clarity and flexibility
Updated the `<param>` documentation for `currentValue` to clarify its behavior. Changed the `currentValue` parameter to be passed by reference (`ref`) to allow direct updates to the caller's variable. Made the `onChanging` delegate nullable and added a null check to prevent potential exceptions. Moved the `cancelled` variable inside the null-check block for `onChanging` to simplify logic. Explicitly updated `currentValue` to `finalValue` after the `doWork` action to ensure consistency. These changes improve the method's robustness, flexibility, and clarity.
* Refactor ChangeProperty calls to use ref parameters
Updated `CWPPropertyHelper.ChangeProperty` calls in `View.Drawing.Scheme.cs` and `View.Layout.cs` to pass fields as `ref` parameters. This ensures direct modification of fields, improving property update handling.
Affected properties:
- `_schemeName` and `_scheme` in `View.Drawing.Scheme.cs`
- `_height` and `_width` in `View.Layout.cs`
Property change notification logic remains unchanged. This refactor enhances maintainability and correctness without introducing new functionality.
Refactor ChangeProperty method for clarity and flexibility
Updated the `<param>` documentation for `currentValue` to clarify its behavior. Changed the `currentValue` parameter to be passed by reference (`ref`) to allow direct updates to the caller's variable. Made the `onChanging` delegate nullable and added a null check to prevent potential exceptions. Moved the `cancelled` variable inside the null-check block for `onChanging` to simplify logic. Explicitly updated `currentValue` to `finalValue` after the `doWork` action to ensure consistency. These changes improve the method's robustness, flexibility, and clarity.
* Initial plan
* Add ScreenChanged event, SetScreenSize method, and fix FakeDriver buffer initialization
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Add comprehensive tests for ScreenChanged event and buffer integrity
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Replace obsolete SizeChanged usage with ScreenChanged in core and tests
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Refactor terminal size event handling
Replaced `ScreenChanged` with `SizeChanged` across the codebase to standardize naming and improve clarity. Updated event handling logic, including subscriptions, unsubscriptions, and raising methods. Removed deprecated `ScreenChanged` event and backward compatibility code.
Refactored driver initialization to handle legacy `IConsoleDriver` types separately. Updated tests and mock implementations to align with the new `SizeChanged` event. Improved documentation and comments to reflect these changes.
These updates enhance maintainability, consistency, and modernize the architecture.
* Refactor & Code Cleanup: Replace IWindowSizeMonitor with IConsoleSizeMonitor
Renamed `IWindowSizeMonitor` to `IConsoleSizeMonitor` across the codebase, updating all references, method signatures, and event handlers. Replaced the `WindowSizeMonitor` class with the new `ConsoleSizeMonitor` implementation, which includes improved terminal size change handling via the `Poll` method.
Enabled nullable reference types in several files to enhance code safety. Updated test cases to reflect the new `IConsoleSizeMonitor` interface. Removed redundant code, simplified null checks, and corrected minor typos in comments. Streamlined the codebase by removing the obsolete `WindowSizeMonitor` class and its interface.
* Code cleanup - Refactor and enhance ShadowView and FakeDriverTests
Updated ShadowView.cs to use null-conditional operators and added null checks for safer access to `ScreenContents`. Refined XML documentation in View.Layout.cs for clarity and consistency.
Refactored FakeDriverTests.cs to leverage modern C# features, including shorthand object instantiation, inline lambdas, and tuple-like syntax for `Size` and `Rectangle`. Removed redundant tests and improved test readability and reliability.
Enhanced error handling with null checks and ensured backward compatibility for deprecated events. Improved test coverage for resizing, clipboard operations, and invalid coordinates. Verified buffer integrity and screen updates after resizing.
General improvements include replacing explicit type declarations with `var`, removing unused imports, and aligning code formatting for better readability.
Refactor and improve code quality and test coverage
Updated `ShadowView` for null safety using null-conditional operators. Simplified object initializations and modernized syntax across the codebase, including shorthand initializations and inline lambdas. Enhanced event handling logic and ensured compatibility with obsolete members.
Refactored `FakeDriverTests` by removing redundant code, standardizing formatting, and improving test setup. Suppressed obsolete warnings where necessary. Improved XML documentation in `View.Layout.cs` for clarity and removed outdated references.
Performed general cleanup, including removing unused namespaces, redundant comments, and ensuring consistent formatting. These changes enhance readability, maintainability, and runtime safety.
* Code cleanup
Refactor TimedEventsTests for readability and consistency
Improved code readability and maintainability:
- Enabled nullable reference types with `#nullable enable`.
- Removed unused `using System.Diagnostics;`.
- Updated namespace to `UnitTests.ApplicationTests`.
- Replaced `Terminal.Gui.App.TimedEvents` with `TimedEvents`.
- Reformatted XML documentation comments for alignment.
- Used `var` and target-typed new expressions for consistency.
- Reformatted `Parallel.For` loops and lambdas for clarity.
- Added `Thread.Sleep(10)` to prevent excessive CPU usage in tests.
- Improved assertions and event handler formatting in tests.
Aligned with modern C# coding practices.
* Code Cleanup - No more driver warnings.
Refactor codebase and introduce FakeClipboard
- Adjusted `.editorconfig` to change severity levels for CS0612, CS0618, and CS0672 diagnostics.
- Replaced `FakeDriver.FakeClipboard` with a new `FakeClipboard` class for testing purposes, supporting exception handling and clipboard data manipulation.
- Removed redundant methods (`MakeColor`, `MapKey`) and unused classes (`MockConsoleDriver`) to streamline the codebase.
- Refactored `ConsoleDriverFacade` and `FakeDriver` to simplify logic and improve maintainability.
- Updated tests to use `CreateFakeDriver` and removed or commented out obsolete tests.
- Reformatted and cleaned up code for readability across multiple files.
* Refactor FakeDriver - Code Cleanup
Standardized console size management by replacing `WindowSizeMonitor` with `ConsoleSizeMonitor` across the codebase. Updated methods `GetWindowSize` and `SetWindowSize` to `GetSize` and `SetSize` for consistency.
Refactored `FakeDriver` to use `SetScreenSize` and removed redundant methods. Simplified driver initialization by removing legacy `InternalInit` logic.
Standardized ANSI escape sequences by replacing `CSI_ReportTerminalSizeInChars` with `CSI_ReportWindowSizeInChars`.
Updated test cases to align with the new `ConsoleSizeMonitor` and `SetScreenSize` methods. Removed obsolete test utilities like `FakeSizeMonitor` and `FakeWindowSizeMonitor`.
Performed general code cleanup, including removing unused classes, redundant code, and improving formatting. Fixed resizing logic issues and improved exception handling in driver methods.
* Update Terminal.Gui/Drivers/OutputBuffer.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update Terminal.Gui/Drivers/MouseButtonStateEx.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update Terminal.Gui/App/MainLoop/IApplicationMainLoop.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update Tests/UnitTests/Views/ToplevelTests.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update Terminal.Gui/ViewBase/View.Layout.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Moved all Drawing tests to Paralleizable - proving Fakedriver works
Enhanced `Ruler` and `Thickness` classes by adding an optional `IConsoleDriver? driver` parameter to decouple rendering from the default `Application.Driver`, improving flexibility and testability. Updated `DriverAssert` to support nullable drivers and added defensive checks.
Refactored and expanded test cases for `Ruler`, `Thickness`, `LineCanvas`, and `StraightLineExtensions` to ensure comprehensive coverage, including zero-length intersections, line rendering, and exclusion logic. Migrated rendering-dependent tests to a parallelizable namespace.
Removed redundant tests, improved naming conventions, and updated documentation for better maintainability and clarity.
* Fixed Run<T> startup hang.
Refactor: Simplify driver logic and update SetSize methods
Removed FakeDriver safeguard in unit tests to simplify
CreateDriver logic. Updated SetSize methods in NetOutput,
UnixOutput, and WindowsOutput to do nothing instead of
throwing NotImplementedException. Modified SizeChanged
event in ConsoleDriverFacade to call SetScreenSize directly.
Commented out unnecessary debug validation in DimAuto.
These changes improve maintainability and reduce complexity.
* Fixed intermittent unit test bug.
Refactored `_cachedRunStateToplevel` to `CachedRunStateToplevel` as an internal static property, delegating its management to `ApplicationImpl` for improved encapsulation. Updated all references to use the new property and centralized its handling in `ApplicationImpl`.
Removed the `MouseGrabHandler` property from `ApplicationImpl` and simplified driver-related assignments by replacing `Application.ForceDriver` and `Application.Screen` with direct references.
Reset `CachedRunStateToplevel` during cleanup to ensure proper state management. Updated the `Invoke` method to use `Top` directly, aligning with the refactored design. Improved debug assertions and performed general cleanup to enhance code readability and maintainability.
* Fixed intermittent bug an massive code cleanup of warnings.
Refactor and enhance codebase for maintainability
- Applied null-conditional operator (`!`) to improve null-safety.
- Refactored tests for clarity, added new cases, and removed redundancies.
- Introduced `FakeApplicationFactory` and `FakeSizeMonitor` for testing.
- Removed unused code, including legacy `DecodeEscSeq` logic.
- Reformatted code for readability and consistency.
- Updated assertions for more accurate validation in tests.
- Fixed potential null reference issues across multiple files.
- Improved event handling with proper null checks.
- Enhanced documentation for new classes and methods.
- Modernized code with C# features like `record struct` and `nullable enable`.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Initial plan
* Initial exploration - understanding TextField Caption and Title
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Remove TextField.Caption and use Title instead with hotkey support
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Add defensive check to ensure TitleTextFormatter.Text is set
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Final changes - all tests passing
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Fixed bugs.
* Add comprehensive tests for caption rendering with attributes validation
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Fix: Disable TextField hotkey functionality to prevent input interception
TextField's Title is used as a caption/placeholder, not for hotkey
navigation. Hotkey visual formatting (underline) is still rendered
in the caption, but hotkey functionality is disabled to prevent
keys like 'E' and 'F' from being intercepted when typing in the field.
Updated test to expect "_Find" instead of "Find" to match resource change.
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Fix: Support Alt+key hotkey navigation while allowing normal typing
Override AddKeyBindingsForHotKey to only bind Alt+key combinations
(e.g., Alt+F for "_Find"), not the bare keys. This allows:
- Alt+F to navigate to the TextField with Title="_Find"
- Normal typing of 'F', 'E', etc. without interception
Previously, both bare key and Alt+key were bound, causing typing
issues. Now TextField properly supports hotkey navigation without
interfering with text input.
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Changes before error encountered
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Refactor hotkey handling to support command context
Refactored `RaiseHandlingHotKey` to accept an `ICommandContext? ctx` parameter, enabling context-aware hotkey handling. Updated `Command.HotKey` definitions across multiple classes (`View`, `CheckBox`, `Label`, `MenuBarv2`, `RadioGroup`, `TextField`) to utilize the new context parameter.
Enhanced XML documentation for `RaiseHandlingHotKey` to clarify its usage and return values. Added a context-aware hotkey handler to `TextField` with additional logic for focus handling.
Refactored attribute initialization and improved code readability in `TextField` by aligning parameters and removing unused `HotKeySpecifier` initialization. These changes improve flexibility, maintainability, and consistency across the codebase.
* Remove TextField.Caption property; use Title with hotkey navigation support
Co-authored-by: tig <585482+tig@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: Tig <tig@users.noreply.github.com>
* Initial plan
* Enable VT processing in WindowsOutput to support hyperlink detection
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Address code review feedback - track VT enablement and add error handling
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Revert VT processing changes - investigating actual root cause
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Implement OSC 8 hyperlink support in Attribute and OutputBase
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Implement automatic URL detection with OSC 8 at driver level
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Fix OSC 8 URL wrapping to handle ANSI escape sequences properly
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Update newinv2.md
Terminal.Gui v2 introduces a reimagined architecture, removing redundant and overly complex code from v1. Key changes include:
- Added TrueColor support with 24-bit RGB handling.
- Introduced modular adornments framework (Margin, Border, Padding).
- Enhanced Unicode and wide character support for internationalization.
- Simplified API with centralized navigation and modern .NET standards.
- Added built-in scrolling via `Viewport` and improved `ScrollBar`.
- Introduced new views (Bar, CharMap, ColorPicker, etc.) and enhanced existing ones.
- Added `ConfigurationManager` for customizable themes and settings.
- Improved visual fidelity with `LineCanvas`, gradients, and borders.
- Introduced logging, metrics, and Sixel image support.
- Enhanced keyboard and mouse APIs for better interaction handling.
- Ensured AOT compatibility for simplified deployment.
These changes modernize the library, improve usability, and expand its capabilities for terminal-based applications.
* Remove automatic URL detection - reverting to clean state
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Revamp View.md documentation for clarity and depth
Comprehensively restructured and enhanced the `View.md` documentation for the `Terminal.Gui` library to improve usability and completeness.
- Added a Table of Contents for easier navigation.
- Rewrote the "View Hierarchy" section to clarify terminology and key properties, with links to relevant API references.
- Expanded "View Composition" and "Core Concepts" sections with detailed explanations of layers, adornments, and scrolling.
- Detailed the "View Lifecycle" with step-by-step processes and code examples for initialization, layout, drawing, input handling, and disposal.
- Reorganized and expanded the "Subsystems" section, covering commands, input handling, layout, drawing, navigation, and scrolling.
- Updated the "Modal Views" section with examples for dialogs, wizards, and modal view types.
- Introduced a "Common View Patterns" section with practical examples for creating custom views, adding subviews, and implementing scrolling.
- Added an "Advanced Topics" section covering diagnostics, view states, and shadow effects.
- Included numerous inline code examples to illustrate key concepts.
- Concluded with a "See Also" section linking to related deep-dive documentation.
These changes significantly improve the structure, clarity, and accessibility of the documentation, making it easier for developers to understand and use the library effectively.
* Restore working automatic URL detection with fix for URLs containing ANSI sequences
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Fix URL regex to handle underscores and trailing punctuation + add comprehensive tests
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Update and expand Configuration Management documentation
The document title was updated to "Configuration Management Deep Dive" to reflect its expanded scope. A new Table of Contents was added for improved navigation. The introduction and "Overview" sections were rewritten to provide a clearer explanation of the `ConfigurationManager` class and its key features.
New sections were added, including "Getting Started," "Themes and Schemes," "Defining Configuration Properties," "Events," and "Best Practices." These sections provide detailed explanations, examples, and recommendations for using the `ConfigurationManager` effectively.
The "Configuration Scopes" and "Configuration Locations and Precedence" sections were restructured and expanded with detailed explanations, diagrams, and examples. Advanced topics such as JSON error handling, runtime configuration, and file system watching were introduced.
The document now includes several new examples, such as theme switching and custom application settings, along with references to related topics and UICatalog examples. The content was reorganized for clarity, with redundant sections removed.
* Refactor and expand Arrangement system documentation
Updated the title to "View Arrangement Deep Dive" and added a Table of Contents for better navigation. Expanded the "Overview" section and restructured "Arrangement Modes" with detailed examples. Added new sections for "Arrange Mode (Interactive)," "Movable Views," "Resizable Views," and "Creating Resizable Splitters," with practical code samples.
Enhanced "Tiled vs Overlapped Layouts" and "Modal Views" sections, and introduced "Runnable Views" to explain non-modal behavior. Expanded the "Examples" section with multiple use cases and added advanced topics like Z-order management and arrangement events.
Updated `arrangement-lexicon.md` with API links for key terms. Improved formatting and consistency throughout the document to enhance clarity and usability.
* Update CONTRIBUTING.md references and add critical note
Updated the reference to `CONTRIBUTING.md` to use a relative
path (`../CONTRIBUTING.md`) for accurate resolution. Enhanced
instructions for AI agents, including CoPilot and Cursor, to
strictly follow the updated guidelines. Added a **CRITICAL**
note requiring CoPilot to internalize and adhere to the
guidelines, including when operating in Agent mode.
* Refactor URL handling and add OSC 8 hyperlink support
Replaced `UrlRegex` with the new `Osc8UrlLinker` utility to handle URL detection and wrapping with OSC 8 hyperlink sequences, improving modularity and maintainability. Updated `OutputBase` to use `Osc8UrlLinker.WrapOsc8` for URL processing and removed legacy `WrapUrlsWithHyperlinks` logic.
Added the `Osc8UrlLinker` class with robust URL parsing, support for allowed schemes, and handling of edge cases like trailing punctuation and ANSI escape sequences. Improved performance with efficient `StringBuilder` usage.
Enhanced `AnimationScenario` to ensure URLs with underscores are drawn correctly. Improved code readability by renaming constants, simplifying nullable handling, and updating documentation.
Replaced legacy `UrlDetectionTests` with `Osc8UrlLinkerTests`, covering standalone URLs, URLs in text, multiple URLs, and edge cases. Verified hyperlink wrapping correctness and visible content integrity.
Updated `Terminal.sln.ToDo.DotSettings` to disable auto-opening of the Stack Trace Explorer. Cleaned up unused code, enabled nullable reference types, and improved XML documentation formatting.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: Tig <tig@users.noreply.github.com>
Terminal.Gui v2 introduces a transformative redesign, simplifying the library's architecture and improving maintainability. Key changes include:
- Added TrueColor support with 24-bit RGB handling.
- Introduced `Adornment` framework for borders, padding, and margins.
- Enhanced Unicode and wide character support for internationalization.
- Added `LineCanvas` for drawing lines and shapes with box-drawing characters.
- Simplified API by consolidating redundant methods and aligning with modern .NET standards.
- Introduced `ConfigurationManager` for user-customizable themes and text styles.
- Improved scrolling with `Viewport` and integrated `ScrollBar`.
- Added new layout features like `Dim.Auto`, `Pos.AnchorEnd`, and `Pos.Align`.
- Overhauled keyboard and mouse APIs for better input handling.
- Introduced new views (e.g., `DatePicker`, `ColorPicker`, `GraphView`) and enhanced existing ones.
- Added Sixel image support for rendering graphics in compatible terminals.
- Ensured AOT compatibility for improved deployment and performance.
This update lays the foundation for building modern, user-friendly terminal applications.
Terminal.Gui v2 introduces a transformative redesign, simplifying the library's architecture and improving maintainability. Key changes include:
- Added TrueColor support with 24-bit RGB handling.
- Introduced `Adornment` framework for borders, padding, and margins.
- Enhanced Unicode and wide character support for internationalization.
- Added `LineCanvas` for drawing lines and shapes with box-drawing characters.
- Simplified API by consolidating redundant methods and aligning with modern .NET standards.
- Introduced `ConfigurationManager` for user-customizable themes and text styles.
- Improved scrolling with `Viewport` and integrated `ScrollBar`.
- Added new layout features like `Dim.Auto`, `Pos.AnchorEnd`, and `Pos.Align`.
- Overhauled keyboard and mouse APIs for better input handling.
- Introduced new views (e.g., `DatePicker`, `ColorPicker`, `GraphView`) and enhanced existing ones.
- Added Sixel image support for rendering graphics in compatible terminals.
- Ensured AOT compatibility for improved deployment and performance.
This update lays the foundation for building modern, user-friendly terminal applications.
* Initial plan
* Refactor tests to use modern ApplicationImpl.Coordinator architecture instead of legacy Application.RunIteration
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Changes before error encountered
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Replace Application.RunIteration implementation to use modern ApplicationImpl.Coordinator architecture
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Simplify Application.RunIteration to directly delegate to ApplicationImpl.Coordinator without legacy infrastructure
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Update multitasking.md documentation to use Application.AddTimeout/RemoveTimeout instead of deprecated Application.MainLoop methods
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Refactor contribution guidelines and documentation
- Consolidated all contribution-related instructions into `CONTRIBUTING.md` as the single source of truth.
- Updated `copilot-instructions.md` and `AGENTS.md` to reference `CONTRIBUTING.md`.
- Enhanced build, test, and CI/CD workflow documentation.
- Updated repository structure documentation in `README.md` and `CONTRIBUTING.md`.
- Reinforced coding conventions and streamlined testing requirements.
- Documented GitHub Actions workflows and provided local CI replication steps.
- Refined API documentation requirements and PR guidelines.
- Simplified `.sln` file and removed redundant content.
- Updated links to point to the latest documentation resources.
* Revamp bug report template for clarity and detail
Updated the bug report template to improve structure, readability, and comprehensiveness:
- Specified "Terminal.Gui" in the `about` section.
- Replaced bold headings with Markdown heading syntax.
- Enhanced "To Reproduce" with placeholders for code and behavior details.
- Added an "Environment" section to collect OS, terminal, PowerShell, .NET, and `Terminal.Gui` version details.
- Expanded "Screenshots" to include GIFs and terminal output instructions.
- Removed outdated "Desktop" and "Smartphone" sections, consolidating relevant details.
- Improved "Additional Context" with prompts for consistency, prior behavior, and error messages.
- Streamlined "For Maintainers" instructions for setting project and milestone.
These changes aim to make bug reports more actionable and easier to reproduce.
* Remove [Obsolete] attribute and pragma warnings from Application.RunIteration - method now uses modern architecture internally
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Refactor Application.Run.cs for clarity and cleanup
Removed debug assertions and unused/commented-out code to simplify logic and improve maintainability. Renamed `forceDraw` to `forceRedraw` in `LayoutAndDraw` for better clarity. Removed the internal `OnNotifyStopRunState` method and its associated logic, indicating a refactor of the stop notification mechanism.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Tig <tig@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Initial plan
* Add missing properties to IApplication and move implementation to ApplicationImpl
- Added Force16Colors, ForceDriver, Sixel, Screen, and ClearScreenNextIteration to IApplication
- Moved implementation of these properties from Application static class to ApplicationImpl
- Updated Application.Driver.cs to delegate to ApplicationImpl.Instance
- Updated Application.Screen.cs to delegate to ApplicationImpl.Instance
- Added ResetScreen() method to ApplicationImpl for proper state cleanup
- Removed TODOs marked "Add to IApplication" in Application.Driver.cs
- All Application-related unit tests passing (180 passed)
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Rename Application.Initialization.cs to Application.Lifecycle.cs
- Changed terminology from "Initialization" to "Lifecycle" as requested
- Updated file comment to reflect lifecycle encompasses Init through Shutdown
- All tests still passing (193 Application-related tests)
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Address code review feedback in Application.Lifecycle.cs
- Fixed typo: 'cam' -> 'can' in XML documentation
- Fixed typo: 'Gets of list' -> 'Gets a list' in XML documentation
- Removed large block of commented-out legacy driver detection code
- Removed extra blank lines for cleaner code formatting
- All tests still passing (180 Application tests)
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Fix potential race condition in ApplicationImpl.Shutdown()
- Reset Screen before calling Application.ResetState() to avoid circular reference
- Application.ResetState() was trying to access ApplicationImpl.Instance while inside Shutdown()
- This could cause race conditions and crashes in test scenarios
- ResetScreen() is now called both in Shutdown() and ResetState() for safety
- All 3116 unit tests passing
Co-authored-by: tig <585482+tig@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: Tig <tig@users.noreply.github.com>
* Initial plan
* Refactor Application.Mouse - Create IMouse interface and Mouse implementation
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Add enhanced documentation for Application.Mouse property
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Add parallelizable unit tests for IMouse interface
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Refactor Application.Mouse for decoupling and parallelism
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Move HandleMouseGrab method to IMouseGrabHandler interface
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Add parallelizable tests for IMouse and IMouseGrabHandler interfaces
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Add MouseEventRoutingTests - 27 parallelizable tests for View mouse event handling
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Fix terminology: Replace parent/child with superView/subView in MouseEventRoutingTests
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Fix coding standards: Use explicit types and target-typed new() in test files
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Update coding standards documentation with explicit var and target-typed new() guidance
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Refactor Application classes and improve maintainability
Refactored `Sixel` property to be immutable, enhancing thread safety.
Cleaned up `ApplicationImpl` by removing redundant fields, restructuring
methods (`CreateDriver`, `CreateSubcomponents`), and improving exception
handling. Updated `Run<T>` and `Shutdown` methods for consistency.
Standardized logging/debugging messages and fixed formatting issues.
Reorganized `IApplication` interface, added detailed XML documentation,
and grouped related methods logically.
Performed general code cleanup, including fixing typos, improving
readability, and removing legacy/unnecessary code to reduce technical debt.
* Code cleanup
* Remove unreferenced LayoutAndDraw method from ApplicationImpl
* Code cleanup and TODOs
- Updated namespaces to reflect the new structure.
- Added `Driver`, `Force16Colors`, and `ForceDriver` properties.
- Introduced `Sixel` collection for sixel image management.
- Added lifecycle methods: `GetDriverTypes`, `Shutdown`, and events.
- Refactored `Init` to support legacy and modern drivers.
- Improved driver event handling and screen abstraction.
- Updated `Run` method to align with the application lifecycle.
- Simplified `IConsoleDriver` documentation.
- Removed redundant methods and improved code readability.
* Refactor LayoutAndDraw logic for better encapsulation
Refactored `Application.Run` to delegate `LayoutAndDraw` to
`ApplicationImpl.Instance.LayoutAndDraw`, improving separation
of concerns. Renamed `forceDraw` to `forceRedraw` for clarity
and moved `LayoutAndDraw` implementation to `ApplicationImpl`.
Added a new `LayoutAndDraw` method in `ApplicationImpl` to
handle layout and drawing, including managing `TopLevels`,
handling active popovers, and refreshing the screen. Updated
the `IApplication` interface to reflect the new method and
improved its documentation.
Implemented `RequestStop` in `ApplicationImpl` and fixed
formatting inconsistencies in `Run<T>`. Added TODOs for future
refactoring to encapsulate `Top` and `TopLevels` into an
`IViewHierarchy` and move certain properties to `IApplication`.
* Refactor ApplicationImpl to enhance mouse and keyboard support
Added a new `Mouse` property to the `ApplicationImpl` class,
replacing its previous declaration, to improve mouse
functionality. Updated `MouseGrabHandler` to initialize with
a default instance of `MouseGrabHandler`.
Added comments to ensure the preservation of existing keyboard
settings (`QuitKey`, `ArrangeKey`, `NextTabKey`) for backward
compatibility. These changes enhance clarity, functionality,
and maintainability of the class.
* Merge IMouseGrabHandler into IMouse - consolidate mouse handling into single interface
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Rename Mouse to MouseImpl and Keyboard to KeyboardImpl for consistency
Co-authored-by: tig <585482+tig@users.noreply.github.com>
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: Tig <tig@users.noreply.github.com>
* Fixes#4320 - Dialog and MessageBox rendering of Text should ignore HasFocus
Refactor and enhance text drawing logic
Refactored `DoDrawText` in `View.Drawing.cs` to improve efficiency by adding early exits for unnecessary operations and introducing extensibility points (`OnDrawingText`, `OnDrewText`, and `DrewText` event). Simplified `DrawText` by delegating logic to `DoDrawText`.
Added `OnDrewText` and `DrewText` event to allow custom post-draw handling. Updated `Dialog` class to ensure consistent text rendering using the `Normal` attribute and cleaned up event handling logic.
* Update Terminal.Gui/ViewBase/View.Drawing.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Refactor Dialog text rendering logic
Refactored the `Dialog` class to improve text rendering behavior:
- Introduced `_drawingText` flag to track text drawing state.
- Updated `OnDrawingText` to set `_drawingText` to `true`.
- Updated `OnDrewText` to reset `_drawingText` to `false`.
- Replaced `GettingAttributeForRoleHandler` with `OnGettingAttributeForRole`.
- Ensures `VisualRole.Focus` uses the normal scheme attribute when drawing text.
- Removed unused event handler `GettingAttributeForRoleHandler`.
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Partial fix - probably breaks stuff
Refactored `FileDialog.cs` by replacing `treeViewContainer` with `_treeView`, adjusting UI component positions, and adding style properties to `_tableView`. Improved user interaction with new event handlers and key bindings. Rearranged `base.Add` calls to reflect the updated UI hierarchy.
* Tweaked Dialog and FileDialog attribute handling
Removed setting of _tableView.Style.InvertSelectedCellFirstCharacter = true;
Commented out custom attribute handling in Dialog.cs for VisualRole.Normal and VisualRole.Focus, reverting to base method. Removed InvertSelectedCellFirstCharacter setting in FileDialog.cs.
* Add tree view toggle to FileDialog
Introduced a new `_btnTreeToggle` button in `FileDialog.cs` to manage the visibility of a tree view within the file dialog interface. Added a new localized string `fdTree` in `Strings.Designer.cs` and `Strings.resx` for UI elements related to the tree view. Adjusted the layout and visibility of the tree and table views to accommodate the toggle functionality. Implemented methods `ToggleTreeVisibility`, `SetTreeVisible`, and `GetTreeToggleText` to handle tree view visibility logic. Cleaned up code and comments for clarity.
* Update localization and test logic for FileDialog
Updated `fdSearchCaption` localization from "Enter search string" to "Find" in `Strings.Designer.cs` and `Strings.resx`. Modified `FileDialogFluentTests.cs` to reflect UI changes by updating button text and removing skip conditions. Adjusted `FileDialogTests.cs` to change `TextField` caption and commented out certain test logic related to path confirmation.
* Moved Search view to be inside the table view container for better usability.
Refactor FileDialog to use nullable reference types
Updated the `FileDialog` class to adopt nullable reference types for improved null safety, marking fields, properties, and methods as nullable where appropriate. Simplified UI component initialization, including repositioning `_tbFind` and `_spinnerView` into `_tableViewContainer` and assigning `Id` properties to `_tableViewContainer` and `_tableView`.
Refactored methods like `TryAcceptMulti` and `GetFocusedFiles` to handle nullability. Simplified `Task.Run` calls and removed unused code, such as the `GetTextField` method and `FileDialogPart` enum, in `FileDialogTests.cs`. Updated tests to directly access subviews using `Id` properties. Minor layout and property adjustments were made to improve maintainability.
* Refactor Dialog class and improve null safety
- Enabled nullable reference types in `Dialog.cs` for better null safety.
- Removed and reintroduced static configuration properties with `[ConfigurationProperty]` attributes for configurability.
- Refactored `Dialog` constructor to use `base.ShadowStyle` and improved button management with alignment logic.
- Updated `Canceled` property with a private backing field and debug assertions.
- Added null-forgiving operators (`!`) across the codebase for nullable reference type compatibility.
- Introduced new test cases to verify `Dialog` behavior, including modal mouse capture and `Canceled` property access.
- Refactored and modernized existing test cases for consistency and readability.
- Removed redundant test cases and performed general code cleanup.
- Improved code comments and debug assertions for clarity and robustness.
* Refactor DialogTests to replace null with empty array
Updated the `BeginButtonTestDialog` method call in `DialogTests.cs`
to replace the `null!` argument with an empty array `[]`. This
improves type safety and ensures explicit handling of the argument.
* Refactor Scrolling.cs for timer management and nullability
Enabled nullable reference types with `#nullable enable` for improved safety. Replaced the `pulsing` flag with a new `_progressTimer` object to better manage the progress bar's timer lifecycle. Updated `AppOnInitialized` and `AppUnloaded` methods to handle timer initialization and cleanup properly, preventing potential memory leaks.
Simplified code by removing unnecessary comments and aligning method signatures with nullable reference type annotations.
* Enable nullable types and add debugging utilities
* Runu tests 5 times
* Adjust abortTime in ScenarioTests to 1800
* Revert "Runu tests 5 times"
This reverts commit b9b5282315.
* Improve CI diagnostics and adjust scenario abort time
* Fix typos, update metadata,
Corrected typos in `ScenarioCategory` and comments in `Mazing.cs`.
Added the `System.Text` namespace to support additional functionality.
Introduced a new "Games" category in `ScenarioCategory`.
Updated `.DotSettings` to include "Mazing" in the user dictionary.
Improved overall code comments and metadata for clarity.
* Remove unnecessary null assertion for _progressTimer
* Update Examples/UICatalog/Scenarios/Scrolling.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Initial plan
* Remove TileView and refactor to use View.Arrangement
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Fix FileDialog container focus behavior - all tests passing
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Remove obsolete TileView comment from View.Hierarchy.cs
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Add resizable splitter example to View.Arrangement docs
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Refactored `TreeView` and `TableView` containersto use View.Arrangment.
Removed unused `_btnToggleSplitterCollapse` and related logic due to the new splitter design.
Simplified collection initialization and feedback/state handling. Improved code readability by replacing magic strings and redundant null checks.
Refactor FileDialog for null safety and UI improvements
Enabled nullable reference types to improve null safety across the codebase. Refactored constants to follow uppercase naming conventions. Introduced nullable annotations for fields and method parameters.
Updated test cases to reflect the removal of deprecated features. Skipped tests related to the removed splitter button. Made miscellaneous improvements, including adding comments and suppressing warnings.
* Add "_Find:" label to FileDialog search field
Co-authored-by: tig <585482+tig@users.noreply.github.com>
* Fixes Parallel unit test intermittent failure case.
Removed the initialization of the `Navigation` object in the `ResetState` method of the `Application` class, indicating a potential shift in its lifecycle management. Enhanced comments to clarify the role of `Shutdown` as a counterpart to `Init`, emphasizing resource cleanup and defensive coding for multithreaded scenarios. Referenced Issue #537 for additional context.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tig <585482+tig@users.noreply.github.com>
Co-authored-by: Tig <tig@users.noreply.github.com>