Skip to main content

CustomActionConfig

Enum CustomActionConfig 

Source
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

§id: String

Action identifier (for keybinding reference)

§title: String

Human-readable title

§command: String

Command to execute (e.g., “git”, “npm”)

§args: Vec<String>

Command arguments (e.g., [“status”, “–short”])

§notify_on_success: bool

Whether to show command output in a notification

§timeout_secs: u64

Timeout in seconds for the command (default: 30)

§capture_output: bool

Capture stdout+stderr into WorkflowContext for use by Sequence/Condition actions. When true, output is capped at 64 KB. Default: false.

§keybinding: Option<String>

Optional keyboard shortcut to trigger the action (e.g., “Ctrl+Shift+R”)

§prefix_char: Option<char>

Optional single character triggered after the global custom action prefix key.

§keybinding_enabled: bool

Whether the keybinding is enabled (default: true)

§description: Option<String>

Optional description

§

NewTab

Open a new tab and optionally run a command in its shell

Fields

§id: String

Action identifier

§title: String

Human-readable title

§command: Option<String>

Optional command to send to the new tab’s shell after it opens

§keybinding: Option<String>

Optional keyboard shortcut to trigger the action

§prefix_char: Option<char>

Optional single character triggered after the global custom action prefix key.

§keybinding_enabled: bool

Whether the keybinding is enabled (default: true)

§description: Option<String>

Optional description

§

InsertText

Insert text into the terminal (like a snippet but no editing UI)

Fields

§id: String

Action identifier

§title: String

Human-readable title

§text: String

Text to insert (supports variable substitution)

§variables: HashMap<String, String>

Custom variables for substitution

§keybinding: Option<String>

Optional keyboard shortcut to trigger the action

§prefix_char: Option<char>

Optional single character triggered after the global custom action prefix key.

§keybinding_enabled: bool

Whether the keybinding is enabled (default: true)

§description: Option<String>

Optional description

§

KeySequence

Simulate a key sequence

Fields

§id: String

Action identifier

§title: String

Human-readable title

§keys: String

Key sequence to simulate (e.g., “Ctrl+C”, “Up Up Down Down”)

§keybinding: Option<String>

Optional keyboard shortcut to trigger the action

§prefix_char: Option<char>

Optional single character triggered after the global custom action prefix key.

§keybinding_enabled: bool

Whether the keybinding is enabled (default: true)

§description: Option<String>

Optional description

§

SplitPane

Split the active pane and optionally send a command to the new pane

Fields

§id: String

Action identifier

§title: String

Human-readable title

§direction: ActionSplitDirection

Split 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 after delay_ms.
  • true: the string is split on whitespace and used as the pane’s initial process (like running htop directly). The pane closes when the process exits.
§command_is_direct: bool

When 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.

§focus_new_pane: bool

Whether to focus the new pane after splitting (default: true)

§delay_ms: u64

Delay in ms before sending the command text to the new pane (default: 200). Only used when command_is_direct is false.

§split_percent: u8

Percent 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%).

§keybinding: Option<String>

Optional keyboard shortcut to trigger the action

§prefix_char: Option<char>

Optional single character triggered after the global custom action prefix key.

§keybinding_enabled: bool

Whether the keybinding is enabled (default: true)

§description: Option<String>

Optional description

§

Sequence

Run an ordered list of actions (steps) in sequence.

Fields

§id: String

Action identifier

§title: String

Human-readable title

§keybinding: Option<String>

Optional keyboard shortcut

§prefix_char: Option<char>

Optional single character triggered after the global custom action prefix key.

§keybinding_enabled: bool

Whether the keybinding is enabled (default: true)

§description: Option<String>

Optional description

§steps: Vec<SequenceStep>

Ordered list of steps to execute.

§

Condition

Evaluate a condition and branch to different actions.

Fields

§id: String

Action identifier

§title: String

Human-readable title

§keybinding: Option<String>

Optional keyboard shortcut

§prefix_char: Option<char>

Optional single character triggered after the global custom action prefix key.

§keybinding_enabled: bool

Whether the keybinding is enabled (default: true)

§description: Option<String>

Optional description

§check: ConditionCheck

The condition to evaluate.

§on_true_id: Option<String>

Action ID to execute when check is true (standalone use only; ignored in Sequence).

§on_false_id: Option<String>

Action ID to execute when check is false (standalone use only; ignored in Sequence).

§

Repeat

Execute an action repeatedly up to N times.

Fields

§id: String

Action identifier

§title: String

Human-readable title

§keybinding: Option<String>

Optional keyboard shortcut

§prefix_char: Option<char>

Optional single character triggered after the global custom action prefix key.

§keybinding_enabled: bool

Whether the keybinding is enabled (default: true)

§description: Option<String>

Optional description

§action_id: String

ID of the action to repeat.

§count: u32

Maximum number of repetitions (1–100).

§delay_ms: u64

Delay in milliseconds between repetitions (default: 0).

§stop_on_success: bool

Stop early when the action succeeds (default: false).

§stop_on_failure: bool

Stop early when the action fails (default: false).

Implementations§

Source§

impl CustomActionConfig

Source

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.).

Source

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.

Source

pub fn id(&self) -> &str

Get the action ID (for keybinding reference).

Source

pub fn title(&self) -> &str

Get the action title (for UI display).

Source

pub fn keybinding(&self) -> Option<&str>

Get the optional keybinding for this action.

Source

pub fn prefix_char(&self) -> Option<char>

Get the optional prefix character for this action.

Source

pub fn normalized_prefix_char(&self) -> Option<char>

Get the normalized prefix character for this action, if configured.

Source

pub fn keybinding_enabled(&self) -> bool

Check if the keybinding is enabled.

Source

pub fn set_keybinding(&mut self, kb: Option<String>)

Set the keybinding for this action.

Source

pub fn set_prefix_char(&mut self, prefix_char: Option<char>)

Set the prefix character for this action.

Source

pub fn set_keybinding_enabled(&mut self, enabled: bool)

Set whether the keybinding is enabled.

Source

pub fn is_shell_command(&self) -> bool

Check if this is a shell command action.

Source

pub fn is_new_tab(&self) -> bool

Check if this is a new tab action.

Source

pub fn is_insert_text(&self) -> bool

Check if this is an insert text action.

Source

pub fn is_key_sequence(&self) -> bool

Check if this is a key sequence action.

Source

pub fn is_split_pane(&self) -> bool

Check if this is a split pane action.

Source

pub fn is_sequence(&self) -> bool

Check if this is a sequence action.

Source

pub fn is_condition(&self) -> bool

Check if this is a condition action.

Source

pub fn is_repeat(&self) -> bool

Check if this is a repeat action.

Source

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 id to avoid keybinding conflicts.
  • The original title suffixed with "-copy".
  • keybinding and prefix_char cleared 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

Source§

fn clone(&self) -> CustomActionConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CustomActionConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for CustomActionConfig

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<CustomActionConfig, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for CustomActionConfig

Source§

fn eq(&self, other: &CustomActionConfig) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for CustomActionConfig

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for CustomActionConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SerializableAny for T
where T: 'static + Any + Clone + for<'a> Send + Sync,

Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more