File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -16,10 +16,6 @@ use deno_core::error::custom_error;
1616use winapi:: shared:: minwindef:: DWORD ;
1717#[ cfg( windows) ]
1818use winapi:: um:: wincon;
19- #[ cfg( windows) ]
20- const RAW_MODE_MASK : DWORD = wincon:: ENABLE_LINE_INPUT
21- | wincon:: ENABLE_ECHO_INPUT
22- | wincon:: ENABLE_PROCESSED_INPUT ;
2319
2420#[ cfg( windows) ]
2521fn get_windows_handle (
@@ -85,11 +81,16 @@ fn op_stdin_set_raw(
8581 {
8682 return Err ( Error :: last_os_error ( ) . into ( ) ) ;
8783 }
84+
85+ const RAW_MODE_MASK : DWORD = wincon:: ENABLE_LINE_INPUT
86+ | wincon:: ENABLE_ECHO_INPUT
87+ | wincon:: ENABLE_PROCESSED_INPUT ;
8888 let new_mode = if is_raw {
89- original_mode & !RAW_MODE_MASK
89+ original_mode & !RAW_MODE_MASK | wincon :: ENABLE_VIRTUAL_TERMINAL_INPUT
9090 } else {
91- original_mode | RAW_MODE_MASK
91+ original_mode | RAW_MODE_MASK & !wincon :: ENABLE_VIRTUAL_TERMINAL_INPUT
9292 } ;
93+
9394 // SAFETY: winapi call
9495 if unsafe { consoleapi:: SetConsoleMode ( handle, new_mode) } == FALSE {
9596 return Err ( Error :: last_os_error ( ) . into ( ) ) ;
You can’t perform that action at this time.
0 commit comments