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

replace MSYS2 write() with WriteFile #2102

Closed
dankamongmen opened this issue Aug 26, 2021 · 2 comments
Closed

replace MSYS2 write() with WriteFile #2102

dankamongmen opened this issue Aug 26, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request mswindows microsoft windows nonfix closed without a successful fix (invalid, wontfix)
Milestone

Comments

@dankamongmen
Copy link
Owner

Now that we're carrying around ti->outhandle, we ought use it with the native WriteFile() call: https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-writefile. In particular, apparently this is necessary to properly use UTF-8 relative to WriteFileConsole(). who knows what Cygwin (or winsock?) write() is doing under the hood.

@dankamongmen dankamongmen added enhancement New feature or request mswindows microsoft windows labels Aug 26, 2021
@dankamongmen dankamongmen added this to the 3.0.0 milestone Aug 26, 2021
@dankamongmen dankamongmen self-assigned this Aug 26, 2021
@dankamongmen
Copy link
Owner Author

it does not look like we need any WriteFileW():

As of now, UTF-8 is supported fully on the standard output stream with the WriteConsole and WriteFile methods. Support on the input stream varies depending on the input mode and will continue to improve over time. Notably the default "cooked" modes on input do not fully support UTF-8 yet. The current status of this work can be found at microsoft/terminal#7777 on GitHub. The workaround is to use the algorithmically-translatable UTF-16 for reading input through ReadConsoleW or ReadConsoleInputW until the outstanding issues are resolved.

https://docs.microsoft.com/en-us/windows/console/classic-vs-vt

@dankamongmen dankamongmen added the nonfix closed without a successful fix (invalid, wontfix) label Oct 8, 2021
@dankamongmen
Copy link
Owner Author

i really doubt this is what solves #2117, which is what this issue is all about. closing it up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request mswindows microsoft windows nonfix closed without a successful fix (invalid, wontfix)
Projects
None yet
Development

No branches or pull requests

1 participant