You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Help users to migrate to new tasks.json version 2.0.0. #22065
To make use of the task execution in the terminal users need to migrate to version 2.0.0 of tasks.json. Support this migration path with a automatic conversion of version 0.1.0 to 2.0.0.
Moving to April. We added API for task in this milestone and we need to wait at least one release before we can finalized the API. Until then we shouldn't finalized the 2.0 version of tasks.
Any idea why a problem matcher under version 0.1.0 correctly finds a single error in task output but when I switch the tasks.json to 2.0.0 the same problem matcher reports the single error multiple times?
cc David Wilson (@daviwil) - I was trying to integrate the Pester problem matcher we ship with the Examples into the PowerShell extension's package.json as a contributed problem matcher named "pesterError".
Keith Hill (@rkeithhill) nothing has changed with problem matchers and the terminal engine is around since 2 releases. Do you have steps to reproduce (best a workspace to clone from). Then I will look into this.
I debugged this further and the problem is that Pester when run in a 'terminal' (a tty/pty is attached) outputs lines n times. This depends on the progress overlay and the height of the terminal.
When run in the output panel we simply spawn a child process without a tty and then no progress or ANSI control characters are emitted.
Long term, it would be nice if the tasks/terminal/problems combo could handle these progress overlays but I can appreciate the difficulties in doing so.
David Wilson (@daviwil) A VSCode-based UI for progress would also eliminate this issue ... if only PowerShell progress reporting wasn't so complex.
Dirk Bäumer (@dbaeumer) BTW now that this problem has a workaround, I see another issue. If the terminal isn't wide enough, the output that the $pester problem matcher looks at changes. That is, what should be a single line with filename and line number on it, gets wrapped to two lines. The problem matcher no longer matches and the problem (test failure) doesn't get flagged. Perhaps I can adjust the problem matcher to handle this but I have to think other folks will run into this issue. cc David Wilson (@daviwil)
Hmm, ah I see. The terminal just reports its current width to PowerShell and PowerShell injects a newline so the output spans two lines. For shells like PowerShell it might be nice if the terminal could provide a minimum width option, say 120 chars wide, and provide scroll bars when the terminal gets narrower than that. A lot of PowerShell output (for better or worse) assumes a console that is at least 120 chars wide.
Daniel Imms (@Tyriar) Just tried on today's Insider build and it doesn't seem to work for PowerShell. :-(
Open PowerShell in the terminal and try executing dir in a narrow terminal window and copy/paste the wrapped output.
The difference may be due to PowerShell's formatting & output engine. PowerShell examines the host's width and adjusts its output - inserting newlines (or truncating with ...) and even placing subsequent lines of data in the appropriate columns e.g.:
In the case of Bash, is it the "terminal" that inserts the newline to force wrapping or does the newline come from Bash? I suspect it is the former, which would make PowerShell behave fundamentally different than Bash in this regard.
You would either need to tell PS how to format (preferable) or the problem matcher would need to know about how PS is formatting these things (less preferable).
On the topic of scroll bars, it would be possible but I'm not sure we would want to go down that route as it's a lot of work/complexity for not much payoff imo. Plus it would further diverge how the terminal behaves on Windows which was always one of the core benefits of VS Code's terminal (how you configure/use it the same on all OS's).
You would either need to tell PS how to format (preferable)
Well if this particular command wrote to the PowerShell output stream I could do that but no, it writes directly to the host so it can "color" the text.
Daniel Imms (@Tyriar) just to clarify for me: the terminal itself is no longer inserting new lines into the emitted data to wrap lines. This is a pure visual thing. Things are different in PowerShell since there the engine itself formats to the width of the screen (not simple line wrapping)
Dirk Bäumer (@dbaeumer) yeah I think that's right and not sure what we can do about it, apart from somehow getting PS not to output like that (some script arg?) or getting tasks to understand this layout better.
The 2.0.0 task system is the default for quite some time. I will close the issue since we don't plan to provide an automatic conversion right now.
If you have problem with the 2.0.0 runner please open a new issue so that we can track it separately. Having a global item will not help addressing them.
Activity
shanalikhan commentedon Mar 15, 2017
https://github.com/shanalikhan/code-settings-sync/blob/master/.vscode/launch.json
https://github.com/shanalikhan/code-settings-sync/blob/master/.vscode/tasks.json
Can you tell me what i have to change in order to switch to 2.0 ?
dbaeumer commentedon Mar 16, 2017
In this simple example change version to
2.0.0dbaeumer commentedon Mar 23, 2017
Moving to April. We added API for task in this milestone and we need to wait at least one release before we can finalized the API. Until then we shouldn't finalized the 2.0 version of tasks.
Spown commentedon Apr 13, 2017
also docs have no mention of
2.0.0either.dbaeumer commentedon Apr 13, 2017
Agree, reason being that this is not the default yet. It got mentioned in the release notes.
rkeithhill commentedon May 31, 2017
Any idea why a problem matcher under version
0.1.0correctly finds a single error in task output but when I switch the tasks.json to2.0.0the same problem matcher reports the single error multiple times?cc David Wilson (@daviwil) - I was trying to integrate the Pester problem matcher we ship with the Examples into the PowerShell extension's package.json as a contributed problem matcher named "pesterError".
dbaeumer commentedon May 31, 2017
Keith Hill (@rkeithhill) nothing has changed with problem matchers and the terminal engine is around since 2 releases. Do you have steps to reproduce (best a workspace to clone from). Then I will look into this.
7 remaining items
dbaeumer commentedon Jul 6, 2017
I debugged this further and the problem is that Pester when run in a 'terminal' (a tty/pty is attached) outputs lines n times. This depends on the progress overlay and the height of the terminal.
When run in the output panel we simply spawn a child process without a tty and then no progress or ANSI control characters are emitted.
I looked in Pester and if I can disable this 'stylish' output but wasn't successful. David Wilson (@daviwil) Keith Hill (@rkeithhill) do you know such an option.
I can also look into de-duping this in VS Code until we have #29840
rkeithhill commentedon Jul 6, 2017
Cool! Yes, we do have a way to eliminate the progress output. I can change the Pester task args from this:
to this:
Long term, it would be nice if the tasks/terminal/problems combo could handle these progress overlays but I can appreciate the difficulties in doing so.
David Wilson (@daviwil) A VSCode-based UI for progress would also eliminate this issue ... if only PowerShell progress reporting wasn't so complex.
Eliminate Pester duplicate failures in Problems view.
rkeithhill commentedon Jul 6, 2017
Dirk Bäumer (@dbaeumer) BTW now that this problem has a workaround, I see another issue. If the terminal isn't wide enough, the output that the $pester problem matcher looks at changes. That is, what should be a single line with filename and line number on it, gets wrapped to two lines. The problem matcher no longer matches and the problem (test failure) doesn't get flagged. Perhaps I can adjust the problem matcher to handle this but I have to think other folks will run into this issue. cc David Wilson (@daviwil)
Hmm, ah I see. The terminal just reports its current width to PowerShell and PowerShell injects a newline so the output spans two lines. For shells like PowerShell it might be nice if the terminal could provide a minimum width option, say 120 chars wide, and provide scroll bars when the terminal gets narrower than that. A lot of PowerShell output (for better or worse) assumes a console that is at least 120 chars wide.
Eliminate Pester duplicate failures in Problems view.
Tyriar commentedon Jul 6, 2017
Keith Hill (@rkeithhill) I think we should be able to determine when a line is wrapped by PowerShell eventually and unwrap it. I just added this recently when copying wrapped lines https://twitter.com/Tyriar/status/875044402867163137
You could verify whether this method should work in PowerShell by trying to copy and paste a wrapped line in the latest Insiders.
rkeithhill commentedon Jul 6, 2017
Daniel Imms (@Tyriar) Just tried on today's Insider build and it doesn't seem to work for PowerShell. :-(
Open PowerShell in the terminal and try executing
dirin a narrow terminal window and copy/paste the wrapped output.The difference may be due to PowerShell's formatting & output engine. PowerShell examines the host's width and adjusts its output - inserting newlines (or truncating with
...) and even placing subsequent lines of data in the appropriate columns e.g.:In the case of Bash, is it the "terminal" that inserts the newline to force wrapping or does the newline come from Bash? I suspect it is the former, which would make PowerShell behave fundamentally different than Bash in this regard.
Tyriar commentedon Jul 6, 2017
Keith Hill (@rkeithhill) yeah maybe that won't work then, for bash it's the pty that does this which is at a higher level than bash. For Windows it works by running PowerShell through https://github.com/rprichard/winpty which allows us to plug in using Unix-like APIs, there are many issues that come out of that though as the Windows APIs around this are not particularly compatible.
This is particularly problematic as there are spaces padding it out:
You would either need to tell PS how to format (preferable) or the problem matcher would need to know about how PS is formatting these things (less preferable).
On the topic of scroll bars, it would be possible but I'm not sure we would want to go down that route as it's a lot of work/complexity for not much payoff imo. Plus it would further diverge how the terminal behaves on Windows which was always one of the core benefits of VS Code's terminal (how you configure/use it the same on all OS's).
rkeithhill commentedon Jul 6, 2017
Well if this particular command wrote to the PowerShell
outputstream I could do that but no, it writes directly to the host so it can "color" the text.dbaeumer commentedon Jul 7, 2017
Daniel Imms (@Tyriar) just to clarify for me: the terminal itself is no longer inserting new lines into the emitted data to wrap lines. This is a pure visual thing. Things are different in PowerShell since there the engine itself formats to the width of the screen (not simple line wrapping)
Tyriar commentedon Jul 7, 2017
Dirk Bäumer (@dbaeumer) yeah I think that's right and not sure what we can do about it, apart from somehow getting PS not to output like that (some script arg?) or getting tasks to understand this layout better.
dbaeumer commentedon Sep 24, 2018
The 2.0.0 task system is the default for quite some time. I will close the issue since we don't plan to provide an automatic conversion right now.
If you have problem with the 2.0.0 runner please open a new issue so that we can track it separately. Having a global item will not help addressing them.