From 79d8342a9d28ea9b329044966d486d2c786ad881 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sun, 9 Feb 2020 13:16:08 -0800 Subject: [PATCH] improve portability of window path/uri check for osc 7 --- src/frontend/gui/termwindow.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/frontend/gui/termwindow.rs b/src/frontend/gui/termwindow.rs index 3662883d6..f9fdae107 100644 --- a/src/frontend/gui/termwindow.rs +++ b/src/frontend/gui/termwindow.rs @@ -1135,7 +1135,8 @@ impl TermWindow { // On Windows the file URI can produce a path like: // `/C:\Users` which is valid in a file URI, but the leading slash // is not liked by the windows file APIs, so we strip it off here. - if cfg!(windows) && path.starts_with('/') { + let bytes = path.as_bytes(); + if bytes.len() > 2 && bytes[0] == b'/' && bytes[2] == b':' { Some(path[1..].to_owned()) } else { Some(path)