Skip to content

Commit b05120f

Browse files
committed
shellIntegration-bash.sh: hygiene: ASCII __vsc_escape_value diagram vs Unicode
1 parent 9d08d67 commit b05120f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,11 @@ __vsc_escape_value() {
6262
# However, the result is a sign-extended int, so a high bit like 0xD7 becomes 0xFFF…FD7
6363
# We mask that word with 0xFF to get lowest 8 bits, and then encode that byte as "\xD7" per our escaping scheme.
6464
builtin printf -v token '\\x%02X' "$(( $(builtin printf '0x%X' "'$byte'") & 0xFF ))"
65-
# └──┬──┘ └┬┘└┬─┘ └─┬──┘ └──┬──┘ └───┬──┘
66-
# store in "token" ─╯ │ │ the hex value ───────────╯ │ │
67-
# the '\x…'-prefixed ─────╯ │ of the byte as an integer ────────╯ │
68-
# 0-padded, two hex digits ──╯ masked to one byte (due to sign extension) ─╯
65+
# |________| ^^^ ^^^ ^^^^^^ ^^^^^^^ |______|
66+
# | | | | | |
67+
# store in `token` -+ | | the hex value -----------+ | |
68+
# the '\x…'-prefixed -----+ | of the byte as an integer --------+ |
69+
# 0-padded, two hex digits --+ masked to one byte (due to sign extension) -+
6970
fi
7071

7172
out+="$token"

0 commit comments

Comments
 (0)