Environment:
- OS: Windows 11 Pro 10.0.26200
- VS Code: 1.109.5 (x64)
- Extension: openai.chatgpt 0.5.76
Steps to reproduce:
- Open the ChatGPT/Codex sidebar in VS Code.
- Obtain any response that contains a Markdown link to a local .md file, for example:
README.md
- Click the link inside the chat message rendering.
Expected:
- The linked local Markdown file opens in a VS Code editor tab.
Actual:
- The link opens via the OS default browser (Microsoft Edge), showing the Markdown in the browser.
Observed routing in extension source:
In webview/assets/index-*.js, the Markdown renderer attaches an onClick handler that dispatches "open-in-browser" for link clicks:
"_blank", rel:"noopener noreferrer", onClick:h=>{!a||!MZt(a)||(h.preventDefault(),Xt.dispatchMessage("open-in-browser",{url:TZt(a)}))}
In out/extension.js, the "open-in-browser" message is handled via vscode.env.openExternal():
case "open-in-browser": {
Ee.env.openExternal(Ee.Uri.parse(r.url));
break;
}
Result:
- When the href is a file:// URI to a local .md, the click path goes through openExternal and is handed to the OS, which opens the default browser (Edge).
Environment:
Steps to reproduce:
README.md
Expected:
Actual:
Observed routing in extension source:
In webview/assets/index-*.js, the Markdown renderer attaches an onClick handler that dispatches "open-in-browser" for link clicks:
"_blank", rel:"noopener noreferrer", onClick:h=>{!a||!MZt(a)||(h.preventDefault(),Xt.dispatchMessage("open-in-browser",{url:TZt(a)}))}
In out/extension.js, the "open-in-browser" message is handled via vscode.env.openExternal():
case "open-in-browser": {
Ee.env.openExternal(Ee.Uri.parse(r.url));
break;
}
Result: