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

onDidEndTaskProcess not called when task terminal closed with vscode.TaskRevealKind.Silent #99828

Closed
badsyntax opened this issue Jun 11, 2020 · 5 comments
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 verified Verification succeeded
Milestone

Comments

@badsyntax
Copy link
Contributor

  • VSCode Version: 1.46.0
  • OS Version: MacOS Catalina

Steps to Reproduce:

(Note the task runs read which will probably only work on Linux/MacOS)

  1. Clone/download this repo: https://github.com/badsyntax/vscode-executetask-test-example
  2. npm i
  3. npm run compile
  4. Open vscode
  5. Open extension.ts and place some breakpoints within onDidStartTaskProcess and onDidEndTaskProcess
  6. Run the Run Extension launch config

Now note the terminal for this task is created. Also note the icon in the statusbar shows the running task. If you close the terminal using the "Bin" button in the terminal panel, the onDidEndTaskProcess handler is not called, but the "running tasks" icon in the statusbar has disappeared and the task has definitely ended.
Restart the extension by running "Run Extension". Open the task terminal. If you send a SIGINT signal (cmd +c) to the terminal, the onDidEndTaskProcess handler is called.

Now change the task.presentationOptions.reveal to vscode.TaskRevealKind.Always, and clicking on the "Bin" button next to the terminal will cause onDidEndTaskProcess to be called.

So it seems like an issue with reveal: vscode.TaskRevealKind.Silent.

Does this issue occur when all extensions are disabled?: Yes

@alexr00 alexr00 added bug Issue identified by VS Code Team member as probable bug tasks Task system issues and removed new release labels Jun 11, 2020
@alexr00 alexr00 added this to the June 2020 milestone Jun 11, 2020
@alexr00
Copy link
Member

alexr00 commented Jun 11, 2020

Thank you providing a repo with a repro!

@alexr00
Copy link
Member

alexr00 commented Jun 11, 2020

There was an exception occurring that was preventing onDidEndTaskProcess from firing. I have pushed a fix. If you can, please let me know if it fixes the issue for you in the next Insiders build.

@badsyntax
Copy link
Contributor Author

Awesome, thanks for the quick fix! Will test with the next insiders build 👍

@badsyntax
Copy link
Contributor Author

I have verified this changes fixes the bug. Thanks!

@alexr00
Copy link
Member

alexr00 commented Jun 16, 2020

Thanks for verifying!

@JacksonKearl JacksonKearl added the verified Verification succeeded label Jul 2, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jul 26, 2020
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 verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants
@badsyntax @JacksonKearl @alexr00 and others