diff options
Diffstat (limited to 'alacritty_terminal/src/ansi.rs')
-rw-r--r-- | alacritty_terminal/src/ansi.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/alacritty_terminal/src/ansi.rs b/alacritty_terminal/src/ansi.rs index 53495995..c47007d8 100644 --- a/alacritty_terminal/src/ansi.rs +++ b/alacritty_terminal/src/ansi.rs @@ -1014,7 +1014,15 @@ where // Hyperlink. b"8" if params.len() > 2 => { let link_params = params[1]; - let uri = str::from_utf8(params[2]).unwrap_or_default(); + + // NOTE: The escape sequence is of form 'OSC 8 ; params ; URI ST', where + // URI is URL-encoded. However `;` is a special character and might be + // passed as is, thus we need to rebuild the URI. + let mut uri = str::from_utf8(params[2]).unwrap_or_default().to_string(); + for param in params[3..].iter() { + uri.push(';'); + uri.push_str(str::from_utf8(param).unwrap_or_default()); + } // The OSC 8 escape sequence must be stopped when getting an empty `uri`. if uri.is_empty() { |