Cargo run/debug configuration
To create a Cargo run/debug configuration, do the following:
Create a Cargo configuration
To create a new configuration, click (or press Alt+Insert) and select Cargo:
Specify the configuration Name. This name will appear in the list of available run/debug configurations.
Specify the preferred configuration settings:
Allow multiple instances
Enable this option if you want to allow multiple instances of the configuration to run simultaneously. Otherwise, re-running the configuration will terminate the active session.
Store as project file
Enable this option to save your configuration as a project file and share it with team members through VCS.
Use the following pattern when specifying the command:[command] [build options] [--] [program arguments]
--prefix followed by an extra space separates Cargo build options from input arguments.
Optionally, specify the preferred channel. It will only affect the current configuration.
Automatically add required features if possible
This option adds
required-featureslisted in relevant Cargo.toml files. The option is enabled by default.
Use all features in tests
This option adds the
--all-featuresflag if you are running a
cargo testcommand. For other commands, this option is ignored.
Emulate terminal in output console
Run with root privileges / Run with Administrator privileges
Enable this option to debug your application as root.
When launching a debug session with root privileges for the first time, you will be prompted whether you want to re-authorize each time you begin debugging or grant authorization for a fixed time period.
Optionally, specify environment variables (overriding or custom). Format them as key-value pairs separated with semicolons, for example:HOME=/home/me.user;MY_APP_DATA=/home/me.user/appdata
If needed, change the directory used by the running task.
Redirect input from
This option allows you to take program input from a file instead of the console.
This option sets the
RUST_BACKTRACEenvironment variable, which prints the unwound stack trace into error messages and controls its length. For more information, refer to Debugging Rust code in CLion: More debug features.
Here you can specify the steps to execute before launch. By default, the Build step is included, which means the IDE will rebuild your sources on every run.
Show this page
Enable this option to always show the run/debug configuration settings prior to actually starting it.
Activate tool window
Use this option to specify whether or not the Run/Debug tool window opens when you start the run/debug configuration.
Click OK to save the configuration.