pub struct CreateOptions {Show 30 fields
pub disabled_options: Vec<String>,
pub enabled_options: Vec<String>,
pub disabled_shopt_options: Vec<String>,
pub enabled_shopt_options: Vec<String>,
pub builtins: HashMap<String, Registration>,
pub working_dir: Option<PathBuf>,
pub disallow_overwriting_regular_files_via_output_redirection: bool,
pub do_not_execute_commands: bool,
pub exit_after_one_command: bool,
pub interactive: bool,
pub login: bool,
pub no_editing: bool,
pub no_profile: bool,
pub no_rc: bool,
pub rc_file: Option<PathBuf>,
pub do_not_inherit_env: bool,
pub fds: Option<HashMap<ShellFd, OpenFile>>,
pub posix: bool,
pub print_commands_and_arguments: bool,
pub read_commands_from_stdin: bool,
pub shell_name: Option<String>,
pub shell_product_display_str: Option<String>,
pub sh_mode: bool,
pub treat_unset_variables_as_error: bool,
pub verbose: bool,
pub command_string_mode: bool,
pub max_function_call_depth: Option<usize>,
pub key_bindings: Option<Arc<Mutex<dyn KeyBindings>>>,
pub error_formatter: Option<Arc<Mutex<dyn ErrorFormatter>>>,
pub shell_version: Option<String>,
}Expand description
Options for creating a new shell.
Fields§
§disabled_options: Vec<String>Disabled options.
enabled_options: Vec<String>Enabled options.
disabled_shopt_options: Vec<String>Disabled shopt options.
enabled_shopt_options: Vec<String>Enabled shopt options.
builtins: HashMap<String, Registration>Registered builtins. Defaults to full bash-compatible builtins.
working_dir: Option<PathBuf>Optional override for initial working directory. If None, defaults to std::env::current_dir(). When provided, the shell will start in this directory instead of inheriting the process’s current directory.
This is critical for HTTP-based MCP tools where the shell should start in the CLIENT’s working directory, not the SERVER’s.
disallow_overwriting_regular_files_via_output_redirection: boolDisallow overwriting regular files via output redirection.
do_not_execute_commands: boolDo not execute commands.
exit_after_one_command: boolExit after one command.
interactive: boolWhether the shell is interactive.
login: boolWhether the shell is a login shell.
no_editing: boolWhether to skip using a readline-like interface for input.
no_profile: boolWhether to skip sourcing the system profile.
no_rc: boolWhether to skip sourcing the user’s rc file.
rc_file: Option<PathBuf>Explicit override of rc file to load in interactive mode.
do_not_inherit_env: boolWhether to skip inheriting environment variables from the calling process.
fds: Option<HashMap<ShellFd, OpenFile>>Provides a set of initial open files to be tracked by the shell.
posix: boolWhether the shell is in POSIX compliance mode.
print_commands_and_arguments: boolWhether to print commands and arguments as they are read.
read_commands_from_stdin: boolWhether commands are being read from stdin.
shell_name: Option<String>The name of the shell.
shell_product_display_str: Option<String>Optionally provides a display string describing the version and variant of the shell.
sh_mode: boolWhether to run in maximal POSIX sh compatibility mode.
treat_unset_variables_as_error: boolWhether to treat expansion of unset variables as an error.
verbose: boolWhether to print verbose output.
command_string_mode: boolWhether the shell is in command string mode (-c).
max_function_call_depth: Option<usize>Maximum function call depth.
key_bindings: Option<Arc<Mutex<dyn KeyBindings>>>Key bindings helper for the shell to use.
error_formatter: Option<Arc<Mutex<dyn ErrorFormatter>>>Error formatter helper for the shell to use.
shell_version: Option<String>Brush implementation version.
Trait Implementations§
Source§impl Default for CreateOptions
impl Default for CreateOptions
Source§fn default() -> CreateOptions
fn default() -> CreateOptions
Auto Trait Implementations§
impl Freeze for CreateOptions
impl !RefUnwindSafe for CreateOptions
impl Send for CreateOptions
impl Sync for CreateOptions
impl Unpin for CreateOptions
impl !UnwindSafe for CreateOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more