1
1
mirror of https://github.com/wez/wezterm.git synced 2024-09-11 14:25:57 +03:00

Ensure order of omitted parameters is retained

Fixes #4730
This commit is contained in:
Josiah Outram Halstead 2024-01-08 15:32:43 +00:00 committed by Wez Furlong
parent 9fc89e621f
commit b6faedf31f

View File

@ -444,6 +444,7 @@ impl VTParser {
for src in &self.params[0..self.num_params] {
if let CsiParam::Integer(value) = src {
res[i] = *value;
} else if let CsiParam::P(b';') = src {
i += 1;
}
}
@ -1103,4 +1104,26 @@ mod test {
]
);
}
#[test]
fn test_ommitted_dcs_param() {
assert_eq!(
parse_as_vec("\x1bP;1q\x1b\\".as_bytes()),
vec![
VTAction::DcsHook {
byte: b'q',
params: vec![0, 1],
intermediates: vec![],
ignored_excess_intermediates: false,
},
VTAction::DcsUnhook,
VTAction::EscDispatch {
params: vec![],
intermediates: vec![],
ignored_excess_intermediates: false,
byte: b'\\',
}
]
);
}
}