-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[process/task] Normalize tasks types and processes
When executing tasks, we now always use node-pty. The difference between a process or a shell task relies in the way the command and its arguments are interpreted/executed: - process: ask the system to spawn a specific executable, with args - shell: defer the spawning to a shell that will evaluate a command line When spawning a process, the expected paramaters are of the kind: spawn(executable, [arg1, arg2, arg3, ...]) While when spawning a shell task, we expect some command like $> executable arg1 "arg 2" ... && sleep 1 || echo fail This commit makes Theia tasks and "terminal processes" (processes spawned via node-pty) able to use both inputs. Signed-off-by: Paul Maréchal <[email protected]> [process] Mark as killed when process errors out Removes some unhandled errors from the tests because we used to not mark processes that errored as `killed`. Also renamed a potential name collision with the global `process` name. Signed-off-by: Paul Maréchal <[email protected]> [process] Add support for arguments in shell task VS Code supports an extra `args` field for shell tasks, and will try its best to build a command-line as `task.command ...task.args`, it will also take the care of escaping some arguments. It is also possible to explicitly define what escaping style you want the task runner to use. This commit makes a best effort to comply to most use cases. Signed-off-by: Paul Maréchal <[email protected]> --- IMPORTANT: Disabled `Terminal Process { shell: true }` on Windows. Problem is that only in this scenario, a lot of garbage ends up in the standard output of the processes, and I have no idea why. In practice this doesn't impact the actual terminals inside Theia. So the tests are disabled on Windows by default, you can have them run by setting an environment variable named `THEIA_PROCESS_TEST_OVERRIDE`.
- Loading branch information
1 parent
126ac74
commit 2b95010
Showing
16 changed files
with
554 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/******************************************************************************** | ||
* Copyright (C) 2019 Ericsson and others. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the Eclipse | ||
* Public License v. 2.0 are satisfied: GNU General Public License, version 2 | ||
* with the GNU Classpath Exception which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
********************************************************************************/ | ||
|
||
import stream = require('stream'); | ||
|
||
/** | ||
* A Node stream like `/dev/null`. | ||
* | ||
* Writing goes to a black hole, reading returns `EOF`. | ||
*/ | ||
export class DevNullStream extends stream.Duplex { | ||
// tslint:disable-next-line:no-any | ||
_write(chunk: any, encoding: string, callback: (err?: Error) => void): void { | ||
callback(); | ||
} | ||
|
||
_read(size: number): void { | ||
// tslint:disable-next-line:no-null-keyword | ||
this.push(null); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.