There was an error while loading. Please reload this page.
1 parent ccf7075 commit c02a080Copy full SHA for c02a080
1 file changed
src/terminal/sys/unix.rs
@@ -230,10 +230,13 @@ fn query_keyboard_enhancement_flags_raw() -> io::Result<Option<KeyboardEnhanceme
230
// ESC [ c Query primary device attributes.
231
const QUERY: &[u8] = b"\x1B[?u\x1B[c";
232
233
- let result = File::open("/dev/tty").and_then(|mut file| {
234
- file.write_all(QUERY)?;
235
- file.flush()
236
- });
+ let result = File::options()
+ .write(true)
+ .open("/dev/tty")
+ .and_then(|mut file| {
237
+ file.write_all(QUERY)?;
238
+ file.flush()
239
+ });
240
if result.is_err() {
241
let mut stdout = io::stdout();
242
stdout.write_all(QUERY)?;
0 commit comments