pub enum CustomActionConfig {
ShellCommand {
id: String,
title: String,
command: String,
args: Vec<String>,
notify_on_success: bool,
timeout_secs: u64,
capture_output: bool,
keybinding: Option<String>,
prefix_char: Option<char>,
keybinding_enabled: bool,
description: Option<String>,
},
NewTab {
id: String,
title: String,
command: Option<String>,
keybinding: Option<String>,
prefix_char: Option<char>,
keybinding_enabled: bool,
description: Option<String>,
},
InsertText {
id: String,
title: String,
text: String,
variables: HashMap<String, String>,
keybinding: Option<String>,
prefix_char: Option<char>,
keybinding_enabled: bool,
description: Option<String>,
},
KeySequence {
id: String,
title: String,
keys: String,
keybinding: Option<String>,
prefix_char: Option<char>,
keybinding_enabled: bool,
description: Option<String>,
},
SplitPane {
id: String,
title: String,
direction: ActionSplitDirection,
command: Option<String>,
command_is_direct: bool,
focus_new_pane: bool,
delay_ms: u64,
split_percent: u8,
keybinding: Option<String>,
prefix_char: Option<char>,
keybinding_enabled: bool,
description: Option<String>,
},
Sequence {
id: String,
title: String,
keybinding: Option<String>,
prefix_char: Option<char>,
keybinding_enabled: bool,
description: Option<String>,
steps: Vec<SequenceStep>,
},
Condition {
id: String,
title: String,
keybinding: Option<String>,
prefix_char: Option<char>,
keybinding_enabled: bool,
description: Option<String>,
check: ConditionCheck,
on_true_id: Option<String>,
on_false_id: Option<String>,
},
Repeat {
id: String,
title: String,
keybinding: Option<String>,
prefix_char: Option<char>,
keybinding_enabled: bool,
description: Option<String>,
action_id: String,
count: u32,
delay_ms: u64,
stop_on_success: bool,
stop_on_failure: bool,
},
}Expand description
A custom action that can be triggered via keybinding.
Actions can execute shell commands, open a new tab, insert text, simulate key sequences, or split the active pane.
Variants§
ShellCommand
Execute a shell command
Fields
capture_output: boolCapture stdout+stderr into WorkflowContext for use by Sequence/Condition actions. When true, output is capped at 64 KB. Default: false.
NewTab
Open a new tab and optionally run a command in its shell
Fields
InsertText
Insert text into the terminal (like a snippet but no editing UI)
Fields
KeySequence
Simulate a key sequence
Fields
SplitPane
Split the active pane and optionally send a command to the new pane
Fields
direction: ActionSplitDirectionSplit direction: horizontal (new pane below) or vertical (new pane right)
command: Option<String>Command for the new pane.
Behaviour depends on command_is_direct:
false(default): text is sent to the shell with a trailing newline afterdelay_ms.true: the string is split on whitespace and used as the pane’s initial process (like runninghtopdirectly). The pane closes when the process exits.
command_is_direct: boolWhen true, command is the pane’s initial process (argv), not a shell command.
The pane closes when the process exits. delay_ms is ignored.
When false (default), command is sent as text to the shell.
delay_ms: u64Delay in ms before sending the command text to the new pane (default: 200).
Only used when command_is_direct is false.
split_percent: u8Percent of the current pane that the existing pane retains after the split. Range 10–90. Default: 66 (existing pane keeps 66%, new pane gets 34%).
Sequence
Run an ordered list of actions (steps) in sequence.
Fields
prefix_char: Option<char>Optional single character triggered after the global custom action prefix key.
steps: Vec<SequenceStep>Ordered list of steps to execute.
Condition
Evaluate a condition and branch to different actions.
Fields
prefix_char: Option<char>Optional single character triggered after the global custom action prefix key.
check: ConditionCheckThe condition to evaluate.
Repeat
Execute an action repeatedly up to N times.
Implementations§
Source§impl CustomActionConfig
impl CustomActionConfig
Sourcepub fn base(&self) -> ActionBase
pub fn base(&self) -> ActionBase
Return a snapshot of the six shared base fields.
Use this to read multiple base fields at once without repeated match arms.
For single-field reads, prefer the dedicated accessors (id(), title(), etc.).
Sourcepub fn apply_base(&mut self, base: ActionBase)
pub fn apply_base(&mut self, base: ActionBase)
Overwrite all six shared base fields from an ActionBase snapshot.
This is the single mutation point that replaces the eight-arm match duplication
previously found in set_keybinding, set_prefix_char, set_keybinding_enabled,
and into_copy.
Sourcepub fn keybinding(&self) -> Option<&str>
pub fn keybinding(&self) -> Option<&str>
Get the optional keybinding for this action.
Sourcepub fn prefix_char(&self) -> Option<char>
pub fn prefix_char(&self) -> Option<char>
Get the optional prefix character for this action.
Sourcepub fn normalized_prefix_char(&self) -> Option<char>
pub fn normalized_prefix_char(&self) -> Option<char>
Get the normalized prefix character for this action, if configured.
Sourcepub fn keybinding_enabled(&self) -> bool
pub fn keybinding_enabled(&self) -> bool
Check if the keybinding is enabled.
Sourcepub fn set_keybinding(&mut self, kb: Option<String>)
pub fn set_keybinding(&mut self, kb: Option<String>)
Set the keybinding for this action.
Sourcepub fn set_prefix_char(&mut self, prefix_char: Option<char>)
pub fn set_prefix_char(&mut self, prefix_char: Option<char>)
Set the prefix character for this action.
Sourcepub fn set_keybinding_enabled(&mut self, enabled: bool)
pub fn set_keybinding_enabled(&mut self, enabled: bool)
Set whether the keybinding is enabled.
Sourcepub fn is_shell_command(&self) -> bool
pub fn is_shell_command(&self) -> bool
Check if this is a shell command action.
Sourcepub fn is_new_tab(&self) -> bool
pub fn is_new_tab(&self) -> bool
Check if this is a new tab action.
Sourcepub fn is_insert_text(&self) -> bool
pub fn is_insert_text(&self) -> bool
Check if this is an insert text action.
Sourcepub fn is_key_sequence(&self) -> bool
pub fn is_key_sequence(&self) -> bool
Check if this is a key sequence action.
Sourcepub fn is_split_pane(&self) -> bool
pub fn is_split_pane(&self) -> bool
Check if this is a split pane action.
Sourcepub fn is_sequence(&self) -> bool
pub fn is_sequence(&self) -> bool
Check if this is a sequence action.
Sourcepub fn is_condition(&self) -> bool
pub fn is_condition(&self) -> bool
Check if this is a condition action.
Sourcepub fn into_copy(&self) -> CustomActionConfig
pub fn into_copy(&self) -> CustomActionConfig
Produce a duplicate of this action suitable for “Clone” in the settings UI.
The returned action has:
- A fresh UUID-based
idto avoid keybinding conflicts. - The original
titlesuffixed with"-copy". keybindingandprefix_charcleared to prevent immediate conflicts.
All other fields are deep-cloned from self.
This replaces the clone_action helper that was previously inlined in
par-term-settings-ui/src/actions_tab.rs (see ARC-006). Keeping the logic here
ensures it stays in sync with the Clone derive on CustomActionConfig.
Trait Implementations§
Source§impl Clone for CustomActionConfig
impl Clone for CustomActionConfig
Source§fn clone(&self) -> CustomActionConfig
fn clone(&self) -> CustomActionConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CustomActionConfig
impl Debug for CustomActionConfig
Source§impl<'de> Deserialize<'de> for CustomActionConfig
impl<'de> Deserialize<'de> for CustomActionConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CustomActionConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CustomActionConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for CustomActionConfig
impl PartialEq for CustomActionConfig
Source§impl Serialize for CustomActionConfig
impl Serialize for CustomActionConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for CustomActionConfig
Auto Trait Implementations§
impl Freeze for CustomActionConfig
impl RefUnwindSafe for CustomActionConfig
impl Send for CustomActionConfig
impl Sync for CustomActionConfig
impl Unpin for CustomActionConfig
impl UnsafeUnpin for CustomActionConfig
impl UnwindSafe for CustomActionConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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