Skip to content

Commit

Permalink
display_width: support BEL as a separator in hyperlinks
Browse files Browse the repository at this point in the history
  • Loading branch information
tertsdiepraam committed Feb 9, 2024
1 parent ff0f8fb commit 5d28004
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,11 @@ pub(crate) fn skip_ansi_escape_sequence<I: Iterator<Item = char>>(ch: char, char
} else if next == Some(']') {
// We have found the start of an Operating System Command, which
// extends until the next sequence "\x1b\\" (the String Terminator
// sequence).
// sequence) or the BEL character. The BEL character is non-standard,
// but it is still used quite often, for example, by GNU ls.
let mut last = ']';
for new in chars {
if new == '\\' && last == CSI.0 {
if new == '\x07' || (new == '\\' && last == CSI.0) {
return true;
}
last = new;
Expand Down

0 comments on commit 5d28004

Please sign in to comment.