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

Extension TerminalLinkProvider cannot detect links in reused task terminals #134841

Closed
ashgti opened this issue Oct 11, 2021 · 1 comment · Fixed by #135419
Closed

Extension TerminalLinkProvider cannot detect links in reused task terminals #134841

ashgti opened this issue Oct 11, 2021 · 1 comment · Fixed by #135419
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders tasks Task system issues terminal General terminal issues that don't fall under another label terminal-links verified Verification succeeded
Milestone

Comments

@ashgti
Copy link
Contributor

ashgti commented Oct 11, 2021

Does this issue occur when all extensions are disabled? Yes

Version: 1.61.0
Commit: ee8c7de
Date: 2021-10-07T18:11:58.853Z
Electron: 13.5.1
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Darwin x64 20.6.0

Steps to Reproduce:

  1. Run the Terminal Sample from the vscode-extension-sample repository https://github.com/microsoft/vscode-extension-samples/blob/main/terminal-sample
  2. Invoke the terminalTest.registerTerminalLinkProvider
  3. Trigger a task that reuses a terminal. For example, I used a user task like:
        {
            "type": "shell",
            "label": "Say Hello",
            "command": [
                "echo link hello!"
            ],
            "problemMatcher": []
        }

On the first run of the task the 'link' text will create a hover link correctly. If you re-run the task so the terminal has 2 (or more) runs of the task in the same terminal then the link will fail to detect correctly.

Adding a breakpoint to https://github.com/microsoft/vscode-extension-samples/blob/main/terminal-sample/src/extension.ts#L162 there appears to be 1 call per execution of the task in the terminal. I think when the terminal is re-used it re-registers the link provider and if two link providers have overlapping links they both seem to fail (which is a known issue #97070 but due to this bug all link providers start failing if tasks are run multiple times).

@ashgti
Copy link
Contributor Author

ashgti commented Oct 12, 2021

Putting a breakpoint in the registerLinkProvider call for xterm (here https://github.com/microsoft/vscode/blob/main/src/vs/workbench/contrib/terminal/browser/links/terminalLinkManager.ts#L150) I see multiple copies of all of the link providers:

Screen Shot 2021-10-12 at 9 15 30 AM

@meganrogge meganrogge added bug Issue identified by VS Code Team member as probable bug terminal General terminal issues that don't fall under another label terminal-links labels Oct 12, 2021
@meganrogge meganrogge added this to the Backlog milestone Oct 12, 2021
@Tyriar Tyriar added the tasks Task system issues label Oct 19, 2021
@meganrogge meganrogge modified the milestones: Backlog, October 2021 Oct 19, 2021
@roblourens roblourens added the verified Verification succeeded label Oct 28, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Dec 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders tasks Task system issues terminal General terminal issues that don't fall under another label terminal-links verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
@ashgti @roblourens @Tyriar @meganrogge and others