Skip to content

ShellConfig

Category: Shell

Source: shell_config.dart

Enums

ShellMode

ValueDescription
nonInteractive
interactive
login

Classes

ShellConfig

Configuration for the shell used to execute commands.

Different shells need different flags — for example, fish uses --login instead of -l, and PowerShell uses -Command instead of -c. This class normalizes those differences so the rest of the codebase doesn't need to care which shell is in use.

Constructor

dart
const ShellConfig({
    this.executable = 'sh',
    this.mode = ShellMode.nonInteractive,
  })
dart
factory ShellConfig.detect({
    String? explicit,
    String? shellEnv,
    ShellMode mode = ShellMode.nonInteractive,
  })

Properties

PropertyTypeDescription
executableString
modeShellMode

Methods

List<String> buildArgs(String command)

Released under the MIT License.