Skip to content

Follow link in terminal results in save dialog #30761

Closed

Description

@MartinNuc
  • VSCode Version: 1.14.1
  • OS Version: macOS Sierra 10.12.5

Steps to Reproduce:

  1. settings: "editor.multiCursorModifier": "ctrlCmd"
  2. open integrated terminal
  3. run echo https://github.com
  4. alt+click on the link
  5. save file dialog appears with filename download.html

screen shot 2017-07-15 at 14 15 27

Expected behaviour: it opens link in a browser

Also the shortcut used to be CMD+click and not ALT+click. I couldn't find where to change it back :-(

This is actually caused by editor.multiCursorModifier settings. I was not aware of that when I created issue.

Reproduces without extensions: Yes

Activity

  1. added
    terminal
    on Jul 15, 2017
  2. changed the title [-]VS Code follow link in terminal results in save dialog[/-] [+]Follow link in terminal results in save dialog[/+] on Jul 15, 2017
  3. Tyriar commented on Jul 15, 2017

    @Tyriar
    Contributor

    Hmm, I can't reproduce, what is your default browser and what is the active program that shows up in the top-left of the screen when you have the save dialog focused?

  4. added
    info-needed
    on Jul 15, 2017
  5. MartinNuc commented on Jul 15, 2017

    @MartinNuc
    Author

    Daniel Imms (@Tyriar) my default browser is Safari. When I focus download dialog the active program remains Code.

    I also tried to write link in the editor and ALT+click works well there.

    Tried running Code using code --verbose --disable-extensions but I dont see any output in console when clicking on the link in terminal :(

    Is there any way to debug what is actually happening?

  6. Tyriar commented on Jul 17, 2017

    @Tyriar
    Contributor

    I'm guessing this is because I just defer to Electron to handle clicking an <a> properly which for some reason isn't behaving in your case. The fix would probably be to explicitly handle opening of the URL at https://github.com/Microsoft/vscode/blob/b4d4d0128fe08798d7fd684d96c0819389eb6bf6/src/vs/workbench/parts/terminal/electron-browser/terminalLinkHandler.ts#L75 in the same way that the editor does it.

  7. added
    help wanted
    bug
    and removed
    info-needed
    on Jul 17, 2017
  8. added this to the Backlog milestone on Jul 17, 2017
  9. cleidigh commented on Jul 18, 2017

    @cleidigh
    Contributor

    Daniel Imms (@Tyriar)
    Seems like something different to work on. Shall I pick this up?

  10. Tyriar commented on Jul 18, 2017

    @Tyriar
    Contributor
  11. cleidigh commented on Jul 19, 2017

    @cleidigh
    Contributor

    Daniel Imms (@Tyriar)
    Clicking links in the integrated terminal on Windows 7 works as expected. (Stable Code, latest Insiders)
    Have to reproduce on OS X, seems surprising that would be platform dependent...

  12. 6 remaining items

  13. Tyriar commented on Jul 20, 2017

    @Tyriar
    Contributor

    Martin Nuc (@MartinNuc) no this issue is fine

  14. cleidigh commented on Jul 20, 2017

    @cleidigh
    Contributor

    Daniel Imms (@Tyriar)
    So I should still try and determine why the download link is opening, correct?
    Also , shouldn't the pop-up be "Option+ Click" as opposed to "Alt + Click" when on OS X?

  15. Tyriar commented on Jul 20, 2017

    @Tyriar
    Contributor

    Yes, we need to figure out why the download link is opening.

    Option and alt are the same key, typically both words are features on the key. We also use alt elsewhere.

  16. cleidigh commented on Jul 20, 2017

    @cleidigh
    Contributor

    Martin Nuc (@MartinNuc)
    I set "editor.multiCursorModifier": "ctrlCmd" on my OS X Sierra system:

    • hover over a terminal linked, pop-up is "Alt + Click"
    • do Alt+Click - no action (should launch link)
    • The same behavior occurs on Windows
    • according to discussion this should launch links on both platforms (a bug but slightly different than your problem , possibly related)

    Is it possible you have some key binding conflict? can you comment everything out and see what happens?

  17. MartinNuc commented on Jul 20, 2017

    @MartinNuc
    Author

    Tried to comment all my custom settings and keybindings, restart and the behaviour was same (download dialog opened).

    I also tried Code - Insiders and download dialog is also opening.

    I updated steps to reproduce in the first post.

  18. cleidigh commented on Jul 20, 2017

    @cleidigh
    Contributor

    Martin Nuc (@MartinNuc)
    Thanks for trying that out.

    Good news , I can reproduce the problem ! In fact it does the same thing on Windows !
    It will be much easier for me to debug this way
    and I think I have some ideas about what's going on.
    Stay tuned...

  19. cleidigh commented on Jul 22, 2017

    @cleidigh
    Contributor

    Daniel Imms (@Tyriar)
    Your prior comment surmising that the default electron link handling might be an issue
    was spot on. The default chromium behavior for clicking on links with Alt is to save the link contents
    thus the save dialog - doesn't matter the platform.

    Have a working fix:
    I created a hypertext link handler and bypassed the default behavior in terminallinkhandler.
    I should be able to cleanup and post a PR by tomorrow afternoon in case you want to include in Sunday's build.
    Cheers

  20. cleidigh commented on Jul 22, 2017

    @cleidigh
    Contributor
  21. added a commit that references this issue on Jul 24, 2017
    37c73f0
  22. added
    verified
    on Aug 3, 2017
  23. locked and limited conversation to collaborators on Nov 17, 2017
  24. added a commit that references this issue on Sep 6, 2026
    00b4b0d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bughelp wantedterminalverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions