jamestalmage / supports-hyperlinks

Detect whether a terminal emulator supports hyperlinks
MIT License
54 stars 13 forks source link

Incorrect results for Windows Terminal #7

Open dropsonic opened 3 years ago

dropsonic commented 3 years ago

Starting with v1.4, Windows Terminal supports embedded hyperlinks. However, supports-hyperlinks returns false for this terminal.

As a workaround, I set the environment variable FORCE_HYPERLINK, and everything started working fine.

It happens because there is a piece of code that disables hyperlink support everywhere on Windows (which is not correct):

if (process.platform === 'win32') {
    return false;
}

It is possible to understand that we're running in Windows Terminal by checking env.WT_SESSION existence; however, it is not so easy to get the actual version of the terminal. See https://github.com/microsoft/terminal/issues/1040 for more details.

jamestalmage commented 3 years ago

PR Welcome.

dropsonic commented 3 years ago

@jamestalmage it is not possible to properly implement it until microsoft/terminal#1040 is completed.

abhijit-hota commented 3 years ago

I was finding ways to know the version number as you said.

One way I thought of was to execute wt -v (wt is included in the Path!). But it opened up an alert window rather than printing it.

I asked why and they said the reason

image

Richienb commented 3 years ago

One way I thought of was to execute wt -v (wt is included in the Path!).

image

Richienb commented 3 years ago

Right now, this is the best way I could find to do it.

abhijit-hota commented 3 years ago

But we also want the version of Windows Terminal, don't we?

On Fri, 8 Jan 2021, 06:48 Richie Bendall, notifications@github.com wrote:

Right now, this is the best way I could find to do it https://github.com/Richienb/is-windows-terminal.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jamestalmage/supports-hyperlinks/issues/7#issuecomment-756485657, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB55PTWKYDQT6YCNBB35MMTSYZMOFANCNFSM4T4P2A7Q .

Richienb commented 3 years ago

@abhijit-hota Perhaps we can get the version from the Windows Store package.

dropsonic commented 3 years ago

According to Microsoft, there is no need to check the exact version of the terminal. I've created a PR: #8