Fix #2961: Output of short-lived tasks is not shown#9409
Fix #2961: Output of short-lived tasks is not shown#9409paul-marechal merged 1 commit intoeclipse-theia:masterfrom
Conversation
| // be ignored. | ||
| if (signal === undefined || signal === 0) { | ||
| this.emitOnExit(code, undefined); | ||
| this.onProcessExited(); |
There was a problem hiding this comment.
More info on exit event ant its params you can find here
| // Get the list of all available running tasks. | ||
| const runningTasks: TaskInfo[] = await this.getRunningTasks(); | ||
| // Get the corresponding task information based on task id if available. | ||
| const taskInfo: TaskInfo | undefined = runningTasks.find((t: TaskInfo) => t.taskId === taskId); |
There was a problem hiding this comment.
In short lived tasks- the task finishes before attached, But still needed to be attached...
|
@simark @marechal-p @vince-fugnitto @akosyakov or any reviewer? |
There was a problem hiding this comment.
This seems to be working for me with both tasks that conclude successfully (echo hello) and those that error out (ls /non-existent-folder), and I believe it addresses the criticism of #7776 that it relied on uncertain timings. Is there any reason to worry that someone might start terminal processes that never get attached to? This seems bind the behavior of the TerminalProcess fairly tightly to a set of expectations that may only apply to the task system.
1dc1667 to
41bba3a
Compare
|
@EstherPerelman, sorry for the delay. I will take another look at this later today or tomorrow. |
b088789 to
912fa52
Compare
colin-grant-work
left a comment
There was a problem hiding this comment.
@marechal-p, I know this something you've given some thought to. Do you have any opinions about the approach adopted here? I think it works, ensures cleanup, and is relatively non-breaking, so I'm inclined to accept it, for now, but maybe there's a better option available without a major refactor?
| resolve(-1); | ||
| }); | ||
|
|
||
| const taskTerm = this.taskTerminalFactory(options); |
There was a problem hiding this comment.
It looks like we're creating both a taskTerminal and a normal terminal in this Promise. Is that intended, or should we create or the other, depending on some conditional?
There was a problem hiding this comment.
I added this after the builds here failed but I think it can be omitted. (removed)
11cdc55 to
1923945
Compare
@marechal-p @colin-grant-work WDYS? Can it be merged? |
colin-grant-work
left a comment
There was a problem hiding this comment.
I'll give my tentative approval, but I'm still hoping someone else will be willing to give a look.
Signed-off-by: Esther Perelman <Esther.Perelman@sap.com>
1923945 to
db77887
Compare
|
@marechal-p Thank you for reviewing! I updated the code accordingly. |
|
@EstherPerelman I am fine with the changes, thanks! Note that I am still working on refactoring processes and terminals, and I'll have a very different implementation than what you did here, although functionality will be the same. I still need more time to finish that refactoring, and I'll be unavailable the whole week that starts May 24th. This means that I'll most likely try to merge my refactoring after the next release. All of that to ask if you are ok with merging your change now, knowing it might be obsolete sometime later after the next release? If so let's merge this PR :) |
@marechal-p I'm ok with merging now, Thank you! |
Signed-off-by: Esther Perelman Esther.Perelman@sap.com
Most of PR description copied from #7776
What it does
How to test
echo hello, and check the task terminal widget for its title and output;Demo:
Review checklist
Reminder for reviewers