Run Configuration Settings

Configuration

Most of the following fields support macros. The little plus-sign on the right guides you which macros are available for a particular property.

Here’s JetBrains help page about run configurations: Run/debug configurations.

Source
Defines the script to execute. You can choose between File and Inline Snippet .
  • File: The file path to the script, which should be executed. Learn more
  • Inline Snippet: Store a snippet inside the run configuration without creating a new shell script on disk. This is usually useful for small utilities or scripts to automate things in your workflow. Learn more
Program arguments
This allows you to pass arguments to the script. This is supported for both file and inline snippet sources. Wrap an argument with double-quotes if it contains spaces, e.g. "first argument" second.
Working directory
This allows you to customize the working directory of your script. The default value is displayed if there’s no custom value set.
Environment variables
This allows you to customize the environment of your script. You can add items in the form key=value. By default, the parent environment is passed. Use the little icon on the right to customize this behaviour.
Interpreter
This allows you to customize the interpreter, which is used to execute your script. The default interpreters are configured in your application settings at FileSettingsLanguages & FrameworksBashSupport Pro .
Automatic
The interpreter is detected automatically.
  1. Inline snippet?
    Then the default Bash interpreter is used.
  2. macOS or Linux? Is the file executable and has a shebang?
    Then your operating system executes the program.
  3. macOS or Linux? Not executable, but has a shebang?
    Then the interpreter and interpreter arguments are parsed from the shebang line.
  4. Windows? Is the file executable, e.g. with a .exe extension?
    Then your operating system executes the program.
  5. As a fallback, the type of your script is determined by shebang, shellcheck source directive, and file extension. Then the default interpreter for this type is used to run your script.
Default Bash interpreter
The first interpreter with type Bash is picked from the list of configured interpreters.
Default POSIX interpreter
The first interpreter with type POSIX is picked from the list of configured interpreters.
Default zsh interpreter
The first interpreter with type Zsh is picked from the list of configured interpreters.
Chosen by your OS
On Linux and macOS files can be made executable. With this setting your operating system will pick the interpreter for you, if there’s one. This is useful to avoid side–effects by your own interpreter settings. You could also use this to run regular executables, which are not shell scripts.
On Windows, you can use this to run files like .exe and .bat.
Custom interpreter path
Finally, this allows you to set your own interpreter for just this run configuration. Please note that this might cause compatibility issues if you share such run configurations with members of your team.
Windows path mapping
This property allows you to define how the script path is mapped on Windows. Paths like C:\dir\file.txt are not valid UNIX paths and need to be mapped to something like /mnt/c/dir/file.txt. WSL, MSYS, and Cygwin all have different mapping strategies and this property allows to configure which mapping should be used, if the automatic detection failed to do the right thing.
Redirect input
This is stdin redirection. This allows you to choose a file, which will be sent to stdin of your executed script. Please note, that ANSI escape codes will not be interpreter in your scripts output if this is defined, because stdin redirection turns of the console emulation.

Advanced Settings

The advanced settings allow you to control some of the more internal behaviour.

Output Charset
If the output appears garbled, then it might be caused by a wrong charset. By default, the system’s default charset is used. But sometimes, especially on Windows, this doesn’t produce the right output.
UTF-8 is often a good choice.

Logs

This is the same log configuration, which you might have already used with other types of run configurations. The table at the top allows you to define log files, which should be opened when you execute this run configuration.

Save console output to file lets you save the content of stdout to a file on disk.

Startup/Connection

This setting is only useful for debugging, when the automatic detection of the version of your Bash interpreter failed. This should only rarely be needed. If you don’t know what to do here, set this to Automatic .

© 2020–2021 Joachim Ansorg
Imprint
Privacy Policy
Legal