|
|
@@ -65,9 +65,12 @@ impl TerminalWidth {
|
|
|
{ terminal_size::terminal_size_of(std::io::stdout()).map(|(w, _h)| w.0 as _) };
|
|
|
#[cfg(windows)]
|
|
|
let stdout_term_width = {
|
|
|
+ use std::os::windows::io::BorrowedHandle;
|
|
|
use windows_sys::Win32::System::Console::{GetStdHandle, STD_OUTPUT_HANDLE};
|
|
|
- terminal_size::terminal_size_using_handle(unsafe { GetStdHandle(STD_OUTPUT_HANDLE) })
|
|
|
- .map(|(w, _h)| w.0 as _)
|
|
|
+ terminal_size::terminal_size_of(unsafe {
|
|
|
+ BorrowedHandle::borrow_raw(GetStdHandle(STD_OUTPUT_HANDLE))
|
|
|
+ })
|
|
|
+ .map(|(w, _h)| w.0 as _)
|
|
|
};
|
|
|
|
|
|
#[rustfmt::skip]
|