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

Terminal sends the same lines twice #44192

Closed
dbaeumer opened this issue Feb 22, 2018 · 9 comments
Closed

Terminal sends the same lines twice #44192

dbaeumer opened this issue Feb 22, 2018 · 9 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) tasks Task system issues windows VS Code on Windows issues
Milestone

Comments

@dbaeumer
Copy link
Member

dbaeumer commented Feb 22, 2018

See #44018 for the discussion and the consequences.

To reproduce:

  • install tsc 2.7.2
  • create new folder
  • change to folder
  • tsc --init
  • open VS Code
  • create a HelloWorlds.ts
  • Run Task > pick the watch task
  • have auto save one
  • change the HelloWorld.ts a couple of times. At some point the Building... in the status line doesn't disappear anymore.

The underlying reason is that the terminal sends lines twice confusing the tracking of the task output.

capture

As you can see in the above screen shot the FIle change detected line at 11:13:12 is send twice resulting in the task to assume that two builds have started but only one compilation complete is send hence the building is kept.

@dbaeumer dbaeumer added bug Issue identified by VS Code Team member as probable bug terminal Integrated terminal issues labels Feb 22, 2018
@dbaeumer
Copy link
Member Author

@Tyriar can you please have a look. This results in a regression with the tasks when using tsc 2.7.x which introduced clearing the terminal when a new compile run triggered through a file change starts.

@dbaeumer
Copy link
Member Author

I tried to debug this but when debugging it doesn't reproduce. I was only able to track this down by adding console.log statements here https://github.com/Microsoft/vscode/blob/master/src\vs\workbench\parts\tasks\electron-browser\terminalTaskSystem.ts#L263

@dbaeumer
Copy link
Member Author

@Tyriar can you please comment. IMO we need to address at least the original bug (even if we introduce some work arounds) for this milestone. It is a bad user experience.

@Tyriar Tyriar added this to the February 2018 milestone Feb 28, 2018
@Tyriar Tyriar added the windows VS Code on Windows issues label Feb 28, 2018
@Tyriar
Copy link
Member

Tyriar commented Feb 28, 2018

I'm not really understanding why the problem matcher system doesn't handle this as the events are still being fired in order, just sometimes they can be duplicated?

When the problem case happens, tryBegin and tryFinish are being called correctly, just tryBegin is being triggered twice. I would expect the second tryBegin to either be ignored or reset the current run.

@Tyriar
Copy link
Member

Tyriar commented Feb 28, 2018

Looking into it deeper, I'm assuming this is to allow problems to be matched on things like gulp tasks which can have multiple different tasks in a single run of a process.

@dbaeumer
Copy link
Member Author

dbaeumer commented Mar 1, 2018

@Tyriar I added a workaround on the task side.

I am still not understanding why the terminal sends the line twice and I sill think that might be a bug. So to clarify:

  • is the tsc comiler issuing the line twice.
  • if not why does the terminal see the line twice.

Other listeners might be affected by this as well.

@dbaeumer
Copy link
Member Author

dbaeumer commented Mar 1, 2018

Actually this is more complicated. It is not that the two identical lines come right after each other. There can be any blank lines in between as well and I am actually concerned that if the output contains errors they might interleave with the begin end as well. So deduping them might get more complicated on the matcher side.

@dbaeumer
Copy link
Member Author

dbaeumer commented Mar 1, 2018

I releases a work around in the problem collector however that meant to capture quite some state.

@Tyriar Tyriar added tasks Task system issues and removed terminal Integrated terminal issues labels Mar 1, 2018
@Tyriar Tyriar assigned dbaeumer and unassigned Tyriar Mar 1, 2018
@dbaeumer dbaeumer removed the bug Issue identified by VS Code Team member as probable bug label Mar 2, 2018
@dbaeumer
Copy link
Member Author

dbaeumer commented Mar 2, 2018

Closing. Dups #44018

@dbaeumer dbaeumer closed this as completed Mar 2, 2018
@chrmarti chrmarti added the *duplicate Issue identified as a duplicate of another issue(s) label Mar 2, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) tasks Task system issues windows VS Code on Windows issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants