File tree Expand file tree Collapse file tree 4 files changed +360
-13
lines changed Expand file tree Collapse file tree 4 files changed +360
-13
lines changed Original file line number Diff line number Diff line change @@ -1062,6 +1062,10 @@ pub const WriteError = error{
10621062
10631063 /// Connection reset by peer.
10641064 ConnectionResetByPeer ,
1065+
1066+ /// This error occurs when trying to write UTF-8 text to a Windows console,
1067+ /// and the UTF-8 to UTF-16 conversion fails. Windows-only.
1068+ InvalidUtf8 ,
10651069} || UnexpectedError ;
10661070
10671071/// Write to a file descriptor.
@@ -3181,8 +3185,7 @@ pub fn isatty(handle: fd_t) bool {
31813185 if (isCygwinPty (handle ))
31823186 return true ;
31833187
3184- var out : windows.DWORD = undefined ;
3185- return windows .kernel32 .GetConsoleMode (handle , & out ) != 0 ;
3188+ return windows .IsConsoleHandle (handle );
31863189 }
31873190 if (builtin .link_libc ) {
31883191 return system .isatty (handle ) != 0 ;
You can’t perform that action at this time.
0 commit comments