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

Implement Fallback for microsoft's terminals. #138

Merged
merged 1 commit into from
Jul 4, 2021

Conversation

ArthurSonzogni
Copy link
Owner

@ArthurSonzogni ArthurSonzogni commented Jul 4, 2021

Implement Fallback for microsoft's terminals.

I finally got access to a computer using the Microsoft's Windows OS.
That's the opportunity to find and mitigate all the problems
encountered. This patch:

  1. Introduce an option and a C++ definition to enable fallback for
    Microsoft's terminal emulators. This allows me to see/test the
    Microsoft output from Linux. This also allows Windows users to remove
    the fallback and target non Microsoft terminals on Windows if needed.

  2. Microsoft's terminal suffer from a race condition bug when reporting
    the cursor position:
    Switch all DSR responses to appending instead of prepending microsoft/terminal#7583.
    The mitigation is not to ask for the cursor position in fullscreen
    mode where it isn't really needed and request it less often.
    This fixes: [BUG] Input fields get random symbols like "[B[AA1" or "B" and others pasted in on every action #136

  3. Microsoft's terminal do not handle properly hidding the cursor. Instead
    the character under the cursor is hidden, which is a big problem. As
    a result, we don't enable setting the cursor to the best position for
    input method editors,
    It will be displayed at the bottom right corner.
    See:

  4. Microsoft's terminals do not provide a way to query if they support
    colors. As a fallback, assume true colors is supported.
    See issue:

  5. The "cmd" on Windows do not properly report its dimension. Powershell
    works correctly. As a fallback, use a 80x80 size instead of 0x0.

  6. There are several dom elements and component displayed incorrectly,
    because the font used is missing several unicode glyph. Use
    alternatives or less detailled one as a fallback.

@ArthurSonzogni
Copy link
Owner Author

Hey @MichaelGoulding,
I finally got a way to test FTXUI on Windows. There are a few problems with this terminal emulator that I do not encounter on the other terminal emulators.

Does the last thing about truecolor capability detection looks like a reasonable thing to do on Windows? Could you please take a look?

I finally got access to a computer using the Microsoft's Windows OS.
That's the opportunity to find and mitigate all the problems
encountered. This patch:

1. Introduce an option and a C++ definition to enable fallback for
   Microsoft's terminal emulators. This allows me to see/test the
   Microsoft output from Linux. This also allows Windows users to remove
   the fallback and target non Microsoft terminals on Windows if needed.

2. Microsoft's terminal suffer from a race condition bug when reporting
   the cursor position:
   microsoft/terminal#7583.
   The mitigation is not to ask for the cursor position in fullscreen
   mode where it isn't really needed and request it less often.
   This fixes: #136

3. Microsoft's terminal do not handle properly hidding the cursor. Instead
   the character under the cursor is hidden, which is a big problem. As
   a result, we don't enable setting the cursor to the best position for
   [input method editors](https://en.wikipedia.org/wiki/Input_method),
   It will be displayed at the bottom right corner.
   See:
   - microsoft/terminal#1203
   - microsoft/terminal#3093

4. Microsoft's terminals do not provide a way to query if they support
   colors. As a fallback, assume true colors is supported.
   See issue:
   - microsoft/terminal#1040
   This mitigates:
   - #135

5. The "cmd" on Windows do not properly report its dimension. Powershell
   works correctly. As a fallback, use a 80x80 size instead of 0x0.

6. There are several dom elements and component displayed incorrectly,
   because the font used is missing several unicode glyph. Use
   alternatives or less detailled one as a fallback.
@ArthurSonzogni ArthurSonzogni force-pushed the fallback-for-microsoft-terminals branch from cee5927 to cebfc31 Compare July 4, 2021 14:59
@ArthurSonzogni
Copy link
Owner Author

@Creapermann. I believe this should mitigate your issue.

@ArthurSonzogni ArthurSonzogni merged commit 81b428a into master Jul 4, 2021
@ArthurSonzogni ArthurSonzogni deleted the fallback-for-microsoft-terminals branch July 4, 2021 15:38
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.

[BUG] Input fields get random symbols like "[B[AA1" or "B" and others pasted in on every action
1 participant