The best way to control Claude Code, Codex and more from any computer or phone
fix(shared): terminal labels after non-BMP letters stay plain text (#19968)
Co-authored-by: Julius Marminge <julius0216@outlook.com> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Karan Kumar committed
Oct 19, 2026 at 11:20 UTC
3017eca6c8802aa8784bcd3b88a56ee559680877
1 file changed
+4
-1
packages/shared/src/composerContextLegacy.ts
+4
-1
@@ -408,9 +408,12 @@ export function upgradeLegacyContextMessage(text: string): UpgradedLegacyContext
408
if (placedTerminals.has(record)) continue;
409
const label = inlineTerminalLabel(record);
410
let at = body.indexOf(label);
411
+ // Alternation instead of a character class: on Electron 44's V8 (15.2) a class
412
+ // directly before `$` with the `u` flag never matches a code point outside the
413
+ // BMP, so `𐐀@build:7` would become a chip (#18272).
414
while (
415
at !== -1 &&
413
- (/[\p{L}\p{N}\p{M}_@.-]$/u.test(body.slice(0, at)) ||
416
+ (/(?:\p{L}|\p{N}|\p{M}|[_@.-])$/u.test(body.slice(0, at)) ||
417
/^(?:[\p{L}\p{N}\p{M}_-]|[.@]+[\p{L}\p{N}\p{M}_-])/u.test(body.slice(at + label.length)))
418
) {
419
at = body.indexOf(label, at + 1);