Bug Description
All clickable hyperlinks rendered by Copilot CLI in terminal output are prefixed with undefined, making them open broken URLs.
Example: A markdown link [repo](https://github.com/user/repo) or bare URL https://github.com/user/repo opens as:
https://undefinedgithub.com/user/repo
Reproduction Steps
- Start a Copilot CLI session (v1.0.15)
- Ask Copilot to output any markdown with URLs (bare,
[text](url), or in code blocks)
- Click any hyperlink in the terminal output
- The browser opens with
undefined prepended to the hostname
Expected Behavior
Links should open the correct URL without any prefix.
Actual Behavior
Every hyperlink gets undefined prepended to the hostname:
https://github.com/... → https://undefinedgithub.com/...
https://learn.microsoft.com/... → https://undefinedlearn.microsoft.com/...
Root Cause (from binary analysis)
The embedded JavaScript URL resolver uses baseUrl which evaluates to undefined. When constructing terminal hyperlinks (OSC 8), the renderer does string concatenation: "undefined" + "github.com" → "undefinedgithub.com".
Relevant strings found in the binary:
get baseUrl() { return this.baseUrl?.origin; }
When this.baseUrl is undefined, the optional chaining returns undefined, which gets stringified during hyperlink construction.
Suggested fix: Add a nullish coalescing fallback: this.baseUrl?.origin ?? "" or skip base URL prepending for absolute URLs.
Environment
- Copilot CLI: v1.0.15-0
- macOS: Sequoia (arm64)
- Terminal: iTerm2 + default Terminal.app (both affected)
render_markdown: true in config.json
Workaround
Setting render_markdown: false avoids the bug but disables all rich formatting.
Bug Description
All clickable hyperlinks rendered by Copilot CLI in terminal output are prefixed with
undefined, making them open broken URLs.Example: A markdown link
[repo](https://github.com/user/repo)or bare URLhttps://github.com/user/repoopens as:Reproduction Steps
[text](url), or in code blocks)undefinedprepended to the hostnameExpected Behavior
Links should open the correct URL without any prefix.
Actual Behavior
Every hyperlink gets
undefinedprepended to the hostname:https://github.com/...→https://undefinedgithub.com/...https://learn.microsoft.com/...→https://undefinedlearn.microsoft.com/...Root Cause (from binary analysis)
The embedded JavaScript URL resolver uses
baseUrlwhich evaluates toundefined. When constructing terminal hyperlinks (OSC 8), the renderer does string concatenation:"undefined" + "github.com"→"undefinedgithub.com".Relevant strings found in the binary:
When
this.baseUrlisundefined, the optional chaining returnsundefined, which gets stringified during hyperlink construction.Suggested fix: Add a nullish coalescing fallback:
this.baseUrl?.origin ?? ""or skip base URL prepending for absolute URLs.Environment
render_markdown: truein config.jsonWorkaround
Setting
render_markdown: falseavoids the bug but disables all rich formatting.