Skip to content

Handle Alt+Click for terminal links. Fixes #30761 - #31263

Merged
Daniel Imms (Tyriar) merged 2 commits into
microsoft:masterfrom
cleidigh:terminal-clicklink/bug
Jul 24, 2017
Merged

Daniel Imms (Tyriar) merged 2 commits into
microsoft:masterfrom
cleidigh:terminal-clicklink/bug

Conversation

@cleidigh

@cleidigh Christopher Leidigh (cleidigh) commented Jul 22, 2017 •

Copy link
Copy Markdown
Contributor

Daniel Imms (@Tyriar)

  • See Follow link in terminal results in save dialog #30761 for discussion
  • Added hypertext link handling to bypass default electron link handling for Alt+Click (was opening save dialog)
  • Tested on Windows and OS X
  • The validate links should provide the error handling before the opener calls

Fixes #30761

@mention-bot

Copy link
Copy Markdown

Christopher Leidigh (@cleidigh), thanks for your PR! By analyzing the history of the files in this pull request, we identified Daniel Imms (@Tyriar) to be a potential reviewer.

@Tyriar Daniel Imms (Tyriar) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Just a few minor comments 😃


this._xterm.setHypertextLinkHandler(this._wrapLinkHandler(uri => {
this._handleHypertextLink(uri);
return;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove this return, plus the one in registerLocalLinkHandler. Not sure why I put them there 😅

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay
anonymous function with void return, explicit return is redundant/unnecessary

callback(true);
}

private _handleHypertextLink(url: string) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add : void return type

private _handleHypertextLink(url: string) {
let uri = Uri.parse(url);
this._openerService.open(uri);
return;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

@Tyriar Daniel Imms (Tyriar) self-assigned this Jul 23, 2017
@Tyriar Daniel Imms (Tyriar) added this to the July 2017 milestone Jul 23, 2017
@cleidigh

Christopher Leidigh (cleidigh) commented Jul 23, 2017 •

Copy link
Copy Markdown
Contributor Author

Daniel Imms (@Tyriar)
Drat, I knew the return types were not quite clear! Probably want to ask some questions later for clarification so I understand better for the future.
Will fix up tomorrow.

@Tyriar
Daniel Imms (Tyriar) merged commit 37c73f0 into microsoft:master Jul 24, 2017
@cleidigh
Christopher Leidigh (cleidigh) deleted the terminal-clicklink/bug branch July 24, 2017 19:00
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Follow link in terminal results in save dialog

4 participants