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

Test: run task in terminal instead of output window #19057

Closed
3 tasks done
dbaeumer opened this issue Jan 23, 2017 · 0 comments
Closed
3 tasks done

Test: run task in terminal instead of output window #19057

dbaeumer opened this issue Jan 23, 2017 · 0 comments

Comments

@dbaeumer
Copy link
Member

dbaeumer commented Jan 23, 2017

Refs: #18312
Complexity: 3

Tasks can now be executed in the terminal instead of the Output window. To enable this you need to add a global property "_runner": "terminal" to the tasks.json file.

Executing a task in a terminal should work as executing a task in the output windows including problem matcher, watching task (now named background tasks) and commands per task. When a task is executed in the terminal you get the additional features:

  • output encoding plus full ANSI character support (comes for free from the terminal)
  • input (the task can read from stdin) (comes for free from the terminal)
  • you can run more than one task in parallel.
  • control over the shell to be used.

Please test that all the features available in the 'output' runner work in the 'terminal' runner plus the newly mentioned features. Try to kill a n active task F1 > task terminate. The terminal runner tries to reuse terminals. Ensure that the reuse strategy makes sense. Play a little with task executed in the terminal. If you have ideas, please let me know. Executing them in the terminal opens new use cases.

Please also note that due to a problem in the terminal command quoting when executed in a shell doesn't work as expected. So a command like "dir "folder with spaces"" is not correctly executed in a cmd.exe run in the terminal. See #19078 for details:

Here is a sample tasks.json to start with:

{
    "version": "0.1.0",
    "_runner": "terminal",
    "tasks": [
        {
            "taskName": "tsc",
            "command": "tsc -w",
            "isShellCommand": true,
            "isBackground": true,
            "problemMatcher": "$tsc-watch",
        },
        {
            "taskName": "dir",
            "command": "dir",
            "windows": {
                "isShellCommand": {
                    "executable": "C:\\Windows\\System32\\cmd.exe",
                    "args": ["/d", "/c"]
                }
            }
        } 
    ]
}

The first task executes the tsc compiler in watch mode (assumes it is available globally). The second one executes the dir command using a special shell path for the terminal.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants