-
Notifications
You must be signed in to change notification settings - Fork 722
Fixes #4250. Add a v2unix driver #4251
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
Conversation
…when exiting constructor.
What is the benefits of these lib methods vs pure ansi? Is it faster? More compatible? |
I didn't understood quite well your question. I used pure ansi in all places where the other drivers use it. The lib methods used here are for leverage native unix libs in the implementation. For e.g. to set console raw mode which allow intercept all the input keys, even Ctrl+C:
So, no pure ansi are used above. But you may referring something that I don't know yet.
Honestly I don't know. Needed to test with benchmark to compare it. But it seems very faster. I also think it's more compatible than |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comments.
There was a problem hiding this 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 PR adds a new Unix driver (v2unix) that uses native Unix libraries for Terminal.Gui, addressing issue #4250. The implementation provides native Unix input/output capabilities as an alternative to the existing .NET-based drivers.
Key changes include:
- Implementation of Unix-specific input/output classes using native Unix system calls
- Integration of the new driver into the existing v2 driver architecture
- Enhanced keyboard input handling with support for Alt key combinations and control sequences
Reviewed Changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
Terminal.Gui/Drivers/V2/UnixInput.cs | Core Unix input implementation using native libc calls for terminal I/O |
Terminal.Gui/Drivers/V2/UnixOutput.cs | Unix output implementation with native terminal control and cursor positioning |
Terminal.Gui/Drivers/V2/UnixInputProcessor.cs | Input processor for handling Unix character stream processing |
Terminal.Gui/Drivers/V2/UnixKeyConverter.cs | Key converter for mapping Unix chars to Terminal.Gui Key objects |
Terminal.Gui/Drivers/V2/UnixComponentFactory.cs | Factory class for creating Unix driver components |
Terminal.Gui/Drivers/V2/ApplicationV2.cs | Integration of Unix driver into the application framework |
Terminal.Gui/Drivers/EscSeqUtils/EscSeqUtils.cs | Enhanced escape sequence utilities with new MapChar method |
Terminal.Gui/Drivers/AnsiResponseParser/Keyboard/EscAsAltPattern.cs | Extended pattern matching for Alt key combinations with control characters |
Tests/UnitTests/Input/EscSeqUtilsTests.cs | New test coverage for MapChar functionality |
Tests/UnitTests/ConsoleDrivers/AnsiKeyboardParserTests.cs | Enhanced keyboard parser tests with Alt modifier support |
Comments suppressed due to low confidence (1)
Terminal.Gui/Drivers/V2/UnixInput.cs:1
- This should be duplicating STDIN_FILENO (0) not STDOUT_FILENO (1) since this is in the UnixInput class and the method is creating a stdin writer, not stdout.
using System.Runtime.InteropServices;
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Fixes
Proposed Changes/Todos
Pull Request checklist:
CTRL-K-D
to automatically reformat your files before committing.dotnet test
before commit///
style comments)