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

Fixes #2928. In the v2 version, using Chinese will cause UI confusion. #2941

Closed
wants to merge 21 commits into from

Conversation

BDisp
Copy link
Collaborator

@BDisp BDisp commented Oct 30, 2023

Fixes #2928- Fixes wide and non-bmp unit points.

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 October 30, 2023 00:56
@BDisp
Copy link
Collaborator Author

BDisp commented Oct 30, 2023

This test Terminal.Gui.ViewsTests.TreeViewTests.TestTreeViewColor sometimes fail and we need to check why.

  Failed Terminal.Gui.ViewsTests.TreeViewTests.TestTreeViewColor [43 ms]
  Error Message:
   System.Exception : Unexpected color White,Black was used at row 0 and col 0 (indexes start at 0).  Color value was White,Black (expected colors were -1,0)
  Stack Trace:
     at Terminal.Gui.TestHelpers.AssertDriverColorsAre(String expectedLook, ConsoleDriver driver, Attribute[] expectedColors) in /home/runner/work/Terminal.Gui/Terminal.Gui/UnitTests/TestHelpers.cs:line 336
   at Terminal.Gui.ViewsTests.TreeViewTests.TestTreeViewColor() in /home/runner/work/Terminal.Gui/Terminal.Gui/UnitTests/Views/TreeViewTests.cs:line 868
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)

Copy link
Collaborator

@tig tig left a comment

Choose a reason for hiding this comment

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

Please see my comments.

Terminal.Gui/ConsoleDrivers/WindowsDriver.cs Show resolved Hide resolved
Terminal.Gui/ConsoleDrivers/WindowsDriver.cs Show resolved Hide resolved
Terminal.Gui/ConsoleDrivers/WindowsDriver.cs Show resolved Hide resolved
@BDisp BDisp force-pushed the v2_wide-non-bmp-fix_2928 branch from 2cbafd6 to 919df85 Compare October 31, 2023 17:55
@tig
Copy link
Collaborator

tig commented Nov 2, 2023

@BDisp you are chasing your tail here.

Please see my fix to #2610. You'll note that the Chinese.cs scenario works fine:

  • Conhost

    • NetDriver
  • WT

    • NetDriver
    • ANSIDriver

Please stop trying to hack WindowsDriver to fix this; it's not worth it IMO. If people want to use conhost, they should use netdriver.

Note ANSIDriver is a LONG way from being finished, but it is the right long term architecture. I plan on making it the basis for an updated curses driver too!

@BDisp
Copy link
Collaborator Author

BDisp commented Nov 2, 2023

@BDisp you are chasing your tail here.

I don't think so.

Please see my fix to #2610. You'll note that the Chinese.cs scenario works fine:

  • Conhost

    • NetDriver
  • WT

    • NetDriver
    • ANSIDriver

Yes, but where is the 'WindowsDriver', the faster one like the 'CursesDriver'?

Please stop trying to hack WindowsDriver to fix this; it's not worth it IMO. If people want to use conhost, they should use netdriver.

Yes and they will freezing on Windows using NetDriver. I hate use it on Windows to be honest.

Note ANSIDriver is a LONG way from being finished, but it is the right long term architecture. I plan on making it the basis for an updated curses driver too!

Yes you are right but to use Ansi escape sequences on Windows only with Windows Terminal works more or less. You are forgetting many others users that use cmd or conhost and I'm showing a workaround to do this without Ansi escape sequences to support all code points.

@BDisp
Copy link
Collaborator Author

BDisp commented Nov 2, 2023

When a user want to run WindowsDriver on cmd or conhost he really want to see this:

image

and this:

image

and not this:

image

nor this:

image

@BDisp
Copy link
Collaborator Author

BDisp commented Nov 3, 2023

@tig I think the best option is submit a PR to your branch and close this one. Do you agree?

@BDisp BDisp closed this Dec 29, 2023
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.

2 participants