-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
@theia/task Doesn't run task, creates new terminal #5825
Comments
A new terminal for a task is expected. Although it should be reused for executing the same task again. It is known issue. From your gifs it looks like taks is actually not properly executed, i.e. output is not there, correct? |
right, the output is not there. So I guess if I want to execute a python script programmatically I should just use the process extension. |
It's a bug.
If you don't want to show output to the end user, yes. If you want then tasks should be handy. |
FYI, this is the extension version from yarn.lock
|
I believe it's a duplicate of the following issue #2961 It looks like the output of short lived tasks are not properly outputted since they complete before a terminal can be created and initialized. |
@vince-fugnitto some is going to look at it? i.e. @elaihau ? fixing such bugs is important for vscode support as well. Or should we mark it as |
I can inform @elaihau about the bug and see if he wants to handle it. He's done some great improvements to the |
I have encountered the same issue. To replicate: protected getWorkspaceContext(): string | undefined {
return this.workspaceService.workspace && this.workspaceService.workspace.uri;
}
async launchTask(arg:string): Promise<void> {
const taskConfig: TaskConfiguration = {
label: 'test runner',
type: 'shell',
command: '/path/to/testscript',
options: {
cwd: this.getWorkspaceContext()
},
_source: this.getWorkspaceContext(),
args: [
//arg
]
};
let taskInfo: TaskInfo;
try {
console.log('Executing this task');
taskInfo = await this.taskServer.run(taskConfig);
if (taskInfo.terminalId !== undefined) {
console.log(taskInfo)
this.logger.debug(`Task created: taskInfo: ${taskInfo}`);
this.taskService.attach(taskInfo.terminalId, taskInfo.taskId);
}
console.log("SUCCESS!")
} catch (error) {
const errorStr = `Error launching task: ${error.message}`;
this.logger.error(errorStr);
return;
}
} Example output:
What is most interesting is that the process that gets started when a task is created, has a PID on my system of |
@elaihau @RomanNikitenko Was it resolved by #6668? |
I think not. @akosyakov |
It is not an easy change. From what I can remember Sven had a PR for it (not merged). |
Description
Terminal/Run task does not execute the example tasks in the tasks readme. Instead, it opens new terminals. To verify it wasn't my environment, I spun up a vm in gcloud with a bash environment. Here are some gifs to demonstrate:
Reproduction Steps
This is while developing my own extension, so to be sure I started a new "hello world" extension project using the tutorial steps. Then I go into "browser-app", execute:
yarn add @theia/task
to add the extension. I also tried running yarn add in my extension directory.
Restart the project and try to run a task.
OS and Theia version:
-gcloud bash environment:
Diagnostics:
There the errors that I see: :
On the zsh environment it is a little more verbose:
So clearly, the task extension cannot find the current terminal and then starts a new terminal, but doesn't run the task either way.
The text was updated successfully, but these errors were encountered: