You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -97,20 +97,22 @@ Check out documentation and other usage examples in the [`docs` directory](./doc
97
97
- `options` (optional): an object containing any of the below:
98
98
- `cwd`: the working directory to be used by all commands. Can be overridden per command.
99
99
Default: `process.cwd()`.
100
+
- `shell`: shell executable used to run command strings. When unset, uses `npm_config_script_shell` if present (for example when run via `npm run`), otherwise `cmd.exe` on Windows or `/bin/sh` elsewhere. See [shell resolution](./docs/shell-resolution.md).
100
101
- `defaultInputTarget`: the default input target when reading from `inputStream`.
101
102
Default: `0`.
102
103
- `handleInput`: when `true`, reads input from `process.stdin`.
103
-
- `inputStream`: a [`Readable` stream](https://nodejs.org/dist/latest-v10.x/docs/api/stream.html#stream_readable_streams)
104
+
- `inputStream`: a [`Readable` stream](https://nodejs.org/docs/latest/api/stream.html#readable-streams)
104
105
to read the input from. Should only be used in the rare instance you would like to stream anything other than `process.stdin`. Overrides `handleInput`.
105
106
- `pauseInputStreamOnFinish`: by default, pauses the input stream (`process.stdin` when `handleInput` is enabled, or `inputStream` if provided) when all of the processes have finished. If you need to read from the input stream after `concurrently` has finished, set this to `false`. ([#252](https://github.com/kimmobrunfeldt/concurrently/issues/252)).
106
107
- `killOthersOn`: once the first command exits with one of these statuses, kill other commands.
107
108
Can be an array containing the strings `success` (status code zero) and/or `failure` (non-zero exit status).
108
109
- `maxProcesses`: how many processes should run at once.
109
-
- `outputStream`: a [`Writable` stream](https://nodejs.org/dist/latest-v10.x/docs/api/stream.html#stream_writable_streams)
110
+
- `outputStream`: a [`Writable` stream](https://nodejs.org/docs/latest/api/stream.html#writable-streams)
110
111
to write logs to. Default: `process.stdout`.
111
112
- `prefix`: the prefix type to use when logging processes output.
112
113
Possible values: `index`, `pid`, `time`, `command`, `name`, `none`, or a template (eg `[{time} process: {pid}]`).
113
114
Default: the name of the process, or its index if no name is set.
115
+
Templates can wrap any portion of the prefix with `{color}` and `{/color}` to restrict coloring to that region (eg `[{color}{name}{/color}]` colors only the name, leaving the brackets uncolored). If either marker is omitted the missing side is implicit, so a template with no markers is colored in full.
114
116
- `prefixColors`: a list of colors or a string as supported by [Chalk](https://www.npmjs.com/package/chalk) and additional style `auto` for an automatically picked color.
115
117
Supports all Chalk color functions: `#RRGGBB`, `bg#RRGGBB`, `hex()`, `bgHex()`, `rgb()`, `bgRgb()`, `ansi256()`, `bgAnsi256()`.
116
118
Functions and modifiers can be chained (e.g., `rgb(255,136,0).bold`, `black.bgHex(#00FF00).dim`).
@@ -221,16 +223,16 @@ It contains the following properties:
221
223
222
224
## FAQ
223
225
224
-
- Process exited with code _null_?
226
+
- Process exited with code `null`?
225
227
226
-
From [Node child_process documentation](http://nodejs.org/api/child_process.html#child_process_event_exit), `exit` event:
228
+
From [Node child_process documentation](https://nodejs.org/docs/latest/api/child_process.html#event-exit), `exit` event:
227
229
228
230
> This event is emitted after the child process ends. If the process
229
231
> terminated normally, code is the final exit code of the process,
230
232
> otherwise null. If the process terminated due to receipt of a signal,
231
233
> signal is the string name of the signal, otherwise null.
232
234
233
-
So _null_ means the process didn't terminate normally. This will make **concurrently**
235
+
So `null` means the process didn't terminate normally. This will make **concurrently**
234
236
to return non-zero exit code too.
235
237
236
238
- Does this work with the npm-replacements [yarn](https://yarnpkg.com/), [pnpm](https://pnpm.io/), or [Bun](https://bun.sh/)?
By default, there are no colors applied to concurrently prefixes, and they just use whatever the terminal's defaults are.
59
+
By default, concurrently automatically assigns colors to each command's prefix, cycling through `cyan`, `magenta`, `green`, `yellow`, and `blue` (the same palette and order used by turborepo).
60
60
61
61
This can be changed by using the `--prefix-colors`/`-c` flag, which takes a comma-separated list of colors to use.<br/>
62
-
The available values are color names (e.g. `green`, `magenta`, `gray`, etc), a hex value (such as `#23de43`), or `auto`, to automatically select a color.
62
+
The available values are color names (e.g. `green`, `magenta`, `gray`, etc), a hex value (such as `#23de43`), `auto` to automatically select a color, or `reset` to disable coloring.
63
63
64
64
```bash
65
65
$ concurrently -c red,blue 'echo Hello there''echo General Kenobi!'
$ concurrently -c 'ansi256(199),ansi256(50).bgAnsi256(17)''echo Pink''echo Cyan on blue'
147
147
```
148
148
149
+
### Scoping the Color to Part of a Template
150
+
151
+
By default, the entire prefix is colored. When using a template, you can restrict coloring to a specific region by wrapping it with the `{color}` and `{/color}` markers — anything outside the markers is rendered without color.
In the example above, only `one` and `two` are colored — the surrounding brackets and the PID stay in the terminal's default color.
158
+
159
+
If only one of the markers is present, the missing side is implicit: an `{color}` without a matching `{/color}` colors everything from the opener to the end of the prefix, and a `{/color}` without a preceding `{color}` colors everything from the start of the prefix up to the closer. A template with neither marker is colored in full, matching the previous behavior.
160
+
149
161
## Prefix Length
150
162
151
163
When using the `command` prefix style, it's possible that it'll be too long.<br/>
Each command runs inside a shell, not as a bare executable.
4
+
By default, concurrently uses `cmd.exe` on Windows and `/bin/sh` elsewhere.
5
+
6
+
## Using a different shell
7
+
8
+
If the default shell isn't suitable, it's possible to instruct concurrently to use a specific shell in a few ways.
9
+
10
+
This is useful, for example, to use Unix-style syntax (for example `BROWSER=none npm start`) on Windows, if you set concurrently shell to e.g. Git Bash.
11
+
12
+
### Via explicit override
13
+
14
+
An explicit shell override takes precedence over every other configuration.
0 commit comments