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

support "presentation" in task config #6713

Closed
elaihau opened this issue Dec 6, 2019 · 16 comments
Closed

support "presentation" in task config #6713

elaihau opened this issue Dec 6, 2019 · 16 comments
Assignees
Labels
tasks issues related to the task system vscode issues related to VSCode compatibility

Comments

@elaihau
Copy link
Contributor

elaihau commented Dec 6, 2019

Description

The way Theia organizes the output of tasks could be controlled by adding the support of "presentation":

https://code.visualstudio.com/docs/editor/tasks#_output-behavior

Reproduction Steps

  • Open the tasks.json of the workspace, and add a task config.

Expected: Users can add the "presentation" object to the config to control the way that the output is presented.
Reality: "presentation" is not supported

OS and Theia version:

Ubuntu 18.04. Example browser.
Version b87052c

@elaihau elaihau added tasks issues related to the task system vscode issues related to VSCode compatibility labels Dec 6, 2019
@elaihau
Copy link
Contributor Author

elaihau commented Dec 6, 2019

This one covers the feature described in #5332

@elaihau elaihau self-assigned this Feb 9, 2020
@elaihau
Copy link
Contributor Author

elaihau commented Feb 9, 2020

I am currently working on presentation.panel, trying to reuse terminal widget(s) across tasks. This is most recent progress I made:

Peek 2020-02-09 17-40

Next step is finishing up the "widget manager", and testing how well / bad this change works with the existing features in Theia.

@akosyakov
Copy link
Member

Next step is finishing up the "widget manager"

What does it mean? :)

@elaihau
Copy link
Contributor Author

elaihau commented Feb 10, 2020

Next step is finishing up the "widget manager"

What does it mean? :)

Sorry for the confusion. I should have said "terminal widget manager".
My idea is having a manager class to decide if a new terminal widget needs to be created. @akosyakov

@akosyakov
Copy link
Member

ok, so something like editor manager based on widget open handler?

@elaihau
Copy link
Contributor Author

elaihau commented Feb 11, 2020

@akosyakov thank you for sharing the insight with me.

yep, similar. but i guess at this point i don't have to extend NavigatableWidgetOpenHandler as i don't need as many features. It could be as simple as a class with only one public method getOrCreateTerminalWidget().

Also, this "terminal widget manager" will be placed inside the "task" extension, as it would only be used by tasks.

@akosyakov
Copy link
Member

yep, similar. but i guess at this point i don't have to extend NavigatableWidgetOpenHandler as i don't need as many features. It could be as simple as a class with only one public method getOrCreateTerminalWidget().

I thought just about WidgetOpenHandler to reuse implementation of open method.

Also, this "terminal widget manager" will be placed inside the "task" extension, as it would only be used by tasks.

We should name it differently then, TerminalManager should leave in the terminal extension. We actually already have it, it is called TerminalService.

@elaihau
Copy link
Contributor Author

elaihau commented Apr 17, 2020

Now we support echo, reveal, focus, panel, showReuseMessage, and clear. am i missing anything for this ticket ?
@vince-fugnitto @RomanNikitenko @akosyakov

@a1994846931931
Copy link
Contributor

a1994846931931 commented Apr 29, 2020

@elaihau

Hi, reuse terminal widget sounds fantastic and I'm really looking forward to the feature coming out. May I ask how's your progress?

Update: I just found out that this feature is already merged into master. Clearly my local repository is far behind master. But nevertheless, l found it behave oddly. See below:
reuse-task

It doesn't act as I expected:

  1. the task failed;
  2. the label of the task terminal seems not correct;
  3. the terminal can not be reused.

Did I does something wrong? FYI, the backend shows the following error:
image

@elaihau
Copy link
Contributor Author

elaihau commented Apr 29, 2020

Update: I just found out that this feature is already merged into master. Clearly my local repository is far behind master. But nevertheless, l found it behave oddly. See below:

It doesn't act as I expected:

  1. the task failed;
  2. the label of the task terminal seems not correct;
  3. the terminal can not be reused.

@a1994846931931
As per your GIF, what you task did was echo Hello.

I guess the error you saw was due to #2961

In your task config, could you please add a sleep 1 before running echo hello, and check if it works ?

@a1994846931931
Copy link
Contributor

Update: I just found out that this feature is already merged into master. Clearly my local repository is far behind master. But nevertheless, l found it behave oddly. See below:

It doesn't act as I expected:

  1. the task failed;
  2. the label of the task terminal seems not correct;
  3. the terminal can not be reused.

@a1994846931931
As per your GIF, what you task did was echo Hello.

I guess the error you saw was due to #2961

In your task config, could you please add a sleep 1 before running echo hello, and check if it works ?

@elaihau
No, it doesn't work. It seems that the command sleep 1 is not executed at all for it returns so quickly.
reuse-task-2

Actually I've also encountered #2961 before, but they look different.

@vince-fugnitto
Copy link
Member

No, it doesn't work. It seems that the command sleep 1 is not executed at all for it returns so quickly.

@a1994846931931 do you mind sharing your tasks.json?
You might also want to check what a bash error code of 127 means as it might help you with your problem.

@elaihau
Copy link
Contributor Author

elaihau commented Apr 30, 2020

@elaihau
No, it doesn't work. It seems that the command sleep 1 is not executed at all for it returns so quickly.
Actually I've also encountered #2961 before, but they look different.

I tried running your task in my env and it worked:

Screenshot from 2020-04-29 22-06-50

maybe i missed some details ...

@RomanNikitenko
Copy link
Contributor

@a1994846931931
I tried your configuration and it works well for me

test_task

But it's interesting to know what's the problem...

@a1994846931931
Copy link
Contributor

@vince-fugnitto @elaihau @RomanNikitenko Hi, I just found out that the issue has something to do with the shell I use - zsh. It worked fine after I shifted back to bash.

@elaihau
Copy link
Contributor Author

elaihau commented May 6, 2020

If there are no objections I will close this ticket in a day.

@elaihau elaihau closed this as completed May 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tasks issues related to the task system vscode issues related to VSCode compatibility
Projects
None yet
Development

No branches or pull requests

5 participants