Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Jul 24, 2017

Conversation

cleidigh
Copy link
Contributor

@cleidigh cleidigh commented Jul 22, 2017

@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

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

Copy link
Member

@Tyriar Tyriar left a comment

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
Member

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
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

@@ -164,6 +170,12 @@ export class TerminalLinkHandler {
callback(true);
}

private _handleHypertextLink(url: string) {
Copy link
Member

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
Member

Choose a reason for hiding this comment

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

Remove

@Tyriar Tyriar self-assigned this Jul 23, 2017
@Tyriar Tyriar added this to the July 2017 milestone Jul 23, 2017
@cleidigh
Copy link
Contributor Author

cleidigh commented Jul 23, 2017

@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 Tyriar merged commit 37c73f0 into microsoft:master Jul 24, 2017
@cleidigh 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