From 2bac3a90bc8ba7f281301577c9ba341011cb20fa Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Fri, 16 Oct 2020 13:58:55 -0700 Subject: [PATCH] properly implement 0ec79a40f6ba46e57271beb1a3223922c48fa637 Properly pull out the legacy OSC code. Thanks tests! --- termwiz/src/escape/osc.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/termwiz/src/escape/osc.rs b/termwiz/src/escape/osc.rs index 816ec07f2..a727df75b 100644 --- a/termwiz/src/escape/osc.rs +++ b/termwiz/src/escape/osc.rs @@ -261,8 +261,9 @@ impl OperatingSystemCommand { // So, for non-numeric OSCs, we look up the prefix and use that. // This only works if the non-numeric OSC code has length == 1. let osc_code = if !p1str.chars().nth(0).unwrap().is_ascii_digit() && osc.len() == 1 { - let p1rest: String = p1str.chars().skip(1).collect(); - OperatingSystemCommandCode::from_code(&p1rest) + let mut p1 = String::new(); + p1.push(p1str.chars().nth(0).unwrap()); + OperatingSystemCommandCode::from_code(&p1) } else { OperatingSystemCommandCode::from_code(&p1str) }