PowerSession-rs
PowerSession-rs copied to clipboard
Runtime Panic "Windows stdio in console mode does not support writing non-UTF-8 byte sequences"
I was trying to record a demo for rbcp, but ran into a runtime panic:
thread '<unnamed>' panicked at src\commands\record.rs:152:40:
failed to flush stdout: Error { kind: InvalidData, message: "Windows stdio in console mode does not support writing non-UTF-8 byte sequences" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '<unnamed>' panicked at src\terminal\impl_win\terminal.rs:259:54:
called `Result::unwrap()` on an `Err` value: SendError { .. }
Here is a video showing what was happening at the time the error occurred. It always fails exactly when the progress bar reaches "30%". It doesn't make sense because that is just an arbitrary value and nothing "new" is being printed after 30% (i.e. the characters are the same as before 30%, during which time it does not error out).
https://github.com/user-attachments/assets/2d65e97e-0355-4773-bb6c-3f4ff4d1fef8
When run with RUST_BACKTRACE=full
RUST_BACKTRACE=fullthread '<unnamed>' panicked at src\commands\record.rs:151:51:
failed to write stdout: Error { kind: InvalidData, message: "Windows stdio in console mode does not support writing non-UTF-8 byte sequences" }
stack backtrace:
0: 0x7ff75654f551 - <unknown>
1: 0x7ff756567c4a - <unknown>
2: 0x7ff75654b317 - <unknown>
3: 0x7ff75654f395 - <unknown>
4: 0x7ff756550e82 - <unknown>
5: 0x7ff756550c73 - <unknown>
6: 0x7ff756551a5f - <unknown>
7: 0x7ff7565517f9 - <unknown>
8: 0x7ff75654fc9f - <unknown>
9: 0x7ff7565513fe - <unknown>
10: 0x7ff756579a51 - <unknown>
11: 0x7ff756579e20 - <unknown>
12: 0x7ff75633da64 - <unknown>
13: 0x7ff756338c79 - <unknown>
14: 0x7ff7565551ad - <unknown>
15: 0x7ffe2f827374 - BaseThreadInitThunk
16: 0x7ffe314fcc91 - RtlUserThreadStart
thread '<unnamed>' panicked at src\terminal\impl_win\terminal.rs:259:54:
called `Result::unwrap()` on an `Err` value: SendError { .. }
stack backtrace:
0: 0x7ff75654f551 - <unknown>
1: 0x7ff756567c4a - <unknown>
2: 0x7ff75654b317 - <unknown>
3: 0x7ff75654f395 - <unknown>
4: 0x7ff756550e82 - <unknown>
5: 0x7ff756550c73 - <unknown>
6: 0x7ff756551a5f - <unknown>
7: 0x7ff7565517f9 - <unknown>
8: 0x7ff75654fc9f - <unknown>
9: 0x7ff7565513fe - <unknown>
10: 0x7ff756579a51 - <unknown>
11: 0x7ff756579e20 - <unknown>
12: 0x7ff75633cbc9 - <unknown>
13: 0x7ff756339582 - <unknown>
14: 0x7ff7565551ad - <unknown>
15: 0x7ffe2f827374 - BaseThreadInitThunk
16: 0x7ffe314fcc91 - RtlUserThreadStart