microsoft / microsoft/terminal

Allow changing the browser/app used to open clicked hyperlinks

Open
#15,495 0 comments 0 reactions 0 assignees View on GitHub
Area-Extensibility Issue-Feature Product-Terminal
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

# Description of the new feature/enhancement

I'd like to be able to change the browser used by a Terminal's profile when clicking links. I use my laptop frequently to SSH into my development machine for work. Most all of our tools require 2FA and will print links to authenticate when their tokens expire. I have a separate browser for work stuff that has a profile managed by our IT team. I don't want to change my default browser so that links from Terminal open in the right place, since that would affect Outlook and stuff.

# Proposed technical implementation details (optional)

Looking at the code, I see all it does is essentially shell out to `open` with the URI in TermainalPage.cpp. I'd like a configuration option
to change this to explicitly use a browser or call my own powershell script to handle it. The default should probably just stay as a shell to `open`, especially if people are wanting to open e.g. `vscode://` or other URIs.

There's a feature request for custom URI handlers that I think could be used in combination with this to leverage the smarter dispatch in Terminal itself, basically "if URI matches pattern, open via this app".

If this seems relatively straightforward and there's a couple PRs you can point me at for adding a configuration option, I can take a stab at a PR to implement this, since this is a daily itch I'd like scratched. But what would take me a couple days would probably take the team a few hours to do better, so if this requires more nuance in the implementation, feel free to triage this as normal.

Contributor guide

Open the contributing guide

Research direction

Start in TerminalPage.cpp, where clicked hyperlinks shell out to `open`, and trace how the Terminal profile configuration is accessed. Define the profile-level browser or command setting while preserving the existing `open` behavior by default. Done means links can use the configured browser or PowerShell script without changing the system default browser.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, powershell
Domain
cli, desktop
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.