Skip to content

Terminal sends the same lines twice #44192

Closed

Description

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.

Activity

  1. added
    bug
    terminal
    on Feb 22, 2018
  2. dbaeumer commented on Feb 22, 2018

    @dbaeumer
    MemberAuthor

    Daniel Imms (@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.

  3. dbaeumer commented on Feb 22, 2018

    @dbaeumer
    MemberAuthor

    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

  4. dbaeumer commented on Feb 26, 2018

    @dbaeumer
    MemberAuthor

    Daniel Imms (@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.

  5. added
    windows
    on Feb 28, 2018
  6. Tyriar commented on Feb 28, 2018

    @Tyriar
    Contributor

    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.

  7. Tyriar commented on Feb 28, 2018

    @Tyriar
    Contributor

    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.

  8. added a commit that references this issue on Feb 28, 2018
    9ce68cb
  9. dbaeumer commented on Mar 1, 2018

    @dbaeumer
    MemberAuthor

    Daniel Imms (@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.

  10. dbaeumer commented on Mar 1, 2018

    @dbaeumer
    MemberAuthor

    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.

  11. dbaeumer commented on Mar 1, 2018

    @dbaeumer
    MemberAuthor

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

  12. added
    tasks
    and removed
    terminal
    on Mar 1, 2018
  13. removed
    bug
    on Mar 2, 2018
  14. dbaeumer commented on Mar 2, 2018

    @dbaeumer
    MemberAuthor

    Closing. Dups #44018

  15. added
    *duplicate
    on Mar 2, 2018
  16. locked and limited conversation to collaborators on Apr 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

*duplicatetaskswindows

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions