Certain invalid UTF-8 sequences can cause the output to fail #5731

Open
opened 2026-01-31 00:20:17 +00:00 by claunia · 0 comments
Owner

Originally created by @j4james on GitHub (Dec 30, 2019).

Environment

Windows build number: Version 10.0.18362.418
Windows Terminal version (if applicable): 0.7.3451.0

Steps to reproduce

  1. Open a bash shell.
  2. Execute the command printf "\xA3"

Expected behavior

I'd expect to see something like the U+FFFD error character, or worst case nothing at all.

Actual behavior

The output is aborted with an error:

-bash: printf: write error: Input/output error

This looks similar to issue #3320, but PR #3380 doesn't fix it, and a recent build from master still produces the problem.

I did a bit of experimenting, and if you replace the MB_ERR_INVALID_CHARS with 0 in the _ParseFullRange method, that seems to help, although I don't know whether that's the right solution.

I know there was a follow up task created which may end up fixing this (#3378), but I thought it best to have the issue filed as an actual bug. If you don't think that's necessary, though, you can always close this as a dup.

Originally created by @j4james on GitHub (Dec 30, 2019). # Environment Windows build number: Version 10.0.18362.418 Windows Terminal version (if applicable): 0.7.3451.0 # Steps to reproduce 1. Open a bash shell. 2. Execute the command `printf "\xA3"` # Expected behavior I'd expect to see something like the U+FFFD error character, or worst case nothing at all. # Actual behavior The output is aborted with an error: -bash: printf: write error: Input/output error This looks similar to issue #3320, but PR #3380 doesn't fix it, and a recent build from master still produces the problem. I did a bit of experimenting, and if you replace the `MB_ERR_INVALID_CHARS` with 0 in the [`_ParseFullRange`](https://github.com/microsoft/terminal/blob/126d489af97fdafbb3194c0cd32f9f99b031f376/src/host/utf8ToWideCharParser.cpp#L296) method, that seems to help, although I don't know whether that's the right solution. I know there was a follow up task created which may end up fixing this (#3378), but I thought it best to have the issue filed as an actual bug. If you don't think that's necessary, though, you can always close this as a dup.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#5731