Config

Struct Config 

Source
pub struct Config {
Show 65 fields pub cols: usize, pub rows: usize, pub font_size: f32, pub font_family: String, pub font_family_bold: Option<String>, pub font_family_italic: Option<String>, pub font_family_bold_italic: Option<String>, pub font_ranges: Vec<FontRange>, pub line_spacing: f32, pub char_spacing: f32, pub enable_text_shaping: bool, pub enable_ligatures: bool, pub enable_kerning: bool, pub window_title: String, pub allow_title_change: bool, pub max_fps: u32, pub vsync_mode: VsyncMode, pub window_padding: f32, pub window_opacity: f32, pub window_always_on_top: bool, pub window_decorations: bool, pub window_width: u32, pub window_height: u32, pub background_image: Option<String>, pub background_image_enabled: bool, pub background_image_mode: BackgroundImageMode, pub background_image_opacity: f32, pub custom_shader: Option<String>, pub custom_shader_enabled: bool, pub custom_shader_animation: bool, pub custom_shader_animation_speed: f32, pub custom_shader_text_opacity: f32, pub custom_shader_full_content: bool, pub auto_copy_selection: bool, pub copy_trailing_newline: bool, pub middle_click_paste: bool, pub mouse_scroll_speed: f32, pub mouse_double_click_threshold: u64, pub mouse_triple_click_threshold: u64, pub scrollback_lines: usize, pub cursor_blink: bool, pub cursor_blink_interval: u64, pub cursor_style: CursorStyle, pub scrollbar_autohide_delay: u64, pub theme: String, pub screenshot_format: String, pub exit_on_shell_exit: bool, pub custom_shell: Option<String>, pub shell_args: Option<Vec<String>>, pub working_directory: Option<String>, pub shell_env: Option<HashMap<String, String>>, pub scrollbar_position: String, pub scrollbar_width: f32, pub scrollbar_thumb_color: [f32; 4], pub scrollbar_track_color: [f32; 4], pub clipboard_max_sync_events: usize, pub clipboard_max_event_bytes: usize, pub notification_bell_desktop: bool, pub notification_bell_sound: u8, pub notification_bell_visual: bool, pub notification_activity_enabled: bool, pub notification_activity_threshold: u64, pub notification_silence_enabled: bool, pub notification_silence_threshold: u64, pub notification_max_buffer: usize,
}
Expand description

Configuration for the terminal emulator Aligned with par-tui-term naming conventions for consistency

Fields§

§cols: usize

Number of columns in the terminal

§rows: usize

Number of rows in the terminal

§font_size: f32

Font size in points

§font_family: String

Font family name (regular/normal weight)

§font_family_bold: Option<String>

Bold font family name (optional, defaults to font_family)

§font_family_italic: Option<String>

Italic font family name (optional, defaults to font_family)

§font_family_bold_italic: Option<String>

Bold italic font family name (optional, defaults to font_family)

§font_ranges: Vec<FontRange>

Custom font mappings for specific Unicode ranges Format: Vec of (start_codepoint, end_codepoint, font_family_name) Example: [(0x4E00, 0x9FFF, “Noto Sans CJK SC”)] for CJK Unified Ideographs

§line_spacing: f32

Line height multiplier (1.0 = tight, 1.2 = default, 1.5 = spacious)

§char_spacing: f32

Character width multiplier (0.5 = narrow, 0.6 = default, 0.7 = wide)

§enable_text_shaping: bool

Enable text shaping for ligatures and complex scripts When enabled, uses HarfBuzz for proper ligature, emoji, and complex script rendering

§enable_ligatures: bool

Enable ligatures (requires enable_text_shaping)

§enable_kerning: bool

Enable kerning adjustments (requires enable_text_shaping)

§window_title: String

Window title

§allow_title_change: bool

Allow applications to change the window title via OSC escape sequences When false, the window title will always be the configured window_title

§max_fps: u32

Maximum frames per second (FPS) target Controls how frequently the terminal requests screen redraws. Note: On macOS, actual FPS may be lower (~22-25) due to system-level VSync throttling in wgpu/Metal, regardless of this setting. Default: 60

§vsync_mode: VsyncMode

VSync mode - controls GPU frame synchronization

  • immediate: No VSync, render as fast as possible (lowest latency, highest power)
  • mailbox: Cap at monitor refresh rate with triple buffering (balanced)
  • fifo: Strict VSync with double buffering (lowest power, slight input lag)

Default: immediate (for maximum performance)

§window_padding: f32

Window padding in pixels

§window_opacity: f32

Window opacity/transparency (0.0 = fully transparent, 1.0 = fully opaque)

§window_always_on_top: bool

Keep window always on top of other windows

§window_decorations: bool

Show window decorations (title bar, borders)

§window_width: u32

Initial window width in pixels

§window_height: u32

Initial window height in pixels

§background_image: Option<String>

Background image path (optional, supports ~ for home directory)

§background_image_enabled: bool

Enable or disable background image rendering (even if a path is set)

§background_image_mode: BackgroundImageMode

Background image display mode

  • fit: Scale to fit window while maintaining aspect ratio (default)
  • fill: Scale to fill window while maintaining aspect ratio (may crop)
  • stretch: Stretch to fill window (ignores aspect ratio)
  • tile: Repeat image in a tiled pattern
  • center: Center image at original size
§background_image_opacity: f32

Background image opacity (0.0 = fully transparent, 1.0 = fully opaque)

§custom_shader: Option<String>

Custom shader file path (GLSL format, relative to shaders folder or absolute) Shaders are loaded from ~/.config/par-term/shaders/ by default Supports Ghostty/Shadertoy-style GLSL shaders with iTime, iResolution, iChannel0

§custom_shader_enabled: bool

Enable or disable the custom shader (even if a path is set)

§custom_shader_animation: bool

Enable animation in custom shader (updates iTime uniform each frame) When disabled, iTime is fixed at 0.0 for static effects

§custom_shader_animation_speed: f32

Animation speed multiplier for custom shader (1.0 = normal speed)

§custom_shader_text_opacity: f32

Text opacity when using custom shader (0.0 = transparent, 1.0 = fully opaque) This allows text to remain readable while the shader effect shows through the background

§custom_shader_full_content: bool

When enabled, the shader receives the full rendered terminal content (text + background) and can manipulate/distort it. When disabled (default), the shader only provides a background and text is composited on top cleanly.

§auto_copy_selection: bool

Automatically copy selected text to clipboard

§copy_trailing_newline: bool

Include trailing newline when copying lines Note: Inverted logic from old strip_trailing_newline_on_copy

§middle_click_paste: bool

Paste on middle mouse button click

§mouse_scroll_speed: f32

Mouse wheel scroll speed multiplier

§mouse_double_click_threshold: u64

Double-click timing threshold in milliseconds

§mouse_triple_click_threshold: u64

Triple-click timing threshold in milliseconds (typically same as double-click)

§scrollback_lines: usize

Maximum number of lines to keep in scrollback buffer

§cursor_blink: bool

Enable cursor blinking

§cursor_blink_interval: u64

Cursor blink interval in milliseconds

§cursor_style: CursorStyle

Cursor style (block, beam, underline)

§scrollbar_autohide_delay: u64

Auto-hide scrollbar after inactivity (milliseconds, 0 = never hide)

§theme: String

Color theme name to use for terminal colors

§screenshot_format: String

File format for screenshots (png, jpeg, svg, html)

§exit_on_shell_exit: bool

Exit when shell exits

§custom_shell: Option<String>

Custom shell command (defaults to system shell if not specified)

§shell_args: Option<Vec<String>>

Arguments to pass to the shell

§working_directory: Option<String>

Working directory for the shell (defaults to current directory)

§shell_env: Option<HashMap<String, String>>

Environment variables to set for the shell

§scrollbar_position: String

Scrollbar position (left or right)

§scrollbar_width: f32

Scrollbar width in pixels

§scrollbar_thumb_color: [f32; 4]

Scrollbar thumb color (RGBA: [r, g, b, a] where each is 0.0-1.0)

§scrollbar_track_color: [f32; 4]

Scrollbar track color (RGBA: [r, g, b, a] where each is 0.0-1.0)

§clipboard_max_sync_events: usize

Maximum clipboard sync events retained for diagnostics

§clipboard_max_event_bytes: usize

Maximum bytes stored per clipboard sync event

§notification_bell_desktop: bool

Forward BEL events to desktop notification centers

§notification_bell_sound: u8

Volume (0-100) for backend bell sound alerts (0 disables)

§notification_bell_visual: bool

Enable backend visual bell overlay

§notification_activity_enabled: bool

Enable notifications when activity resumes after inactivity

§notification_activity_threshold: u64

Seconds of inactivity required before an activity alert fires

§notification_silence_enabled: bool

Enable notifications after prolonged silence

§notification_silence_threshold: u64

Seconds of silence before a silence alert fires

§notification_max_buffer: usize

Maximum number of OSC 9/777 notification entries retained by backend

Implementations§

Source§

impl Config

Source

pub fn new() -> Self

Create a new configuration with default values

Source

pub fn load() -> Result<Self>

Load configuration from file or create default

Source

pub fn save(&self) -> Result<()>

Save configuration to file

Source

pub fn config_path() -> PathBuf

Get the configuration file path (using XDG convention)

Source

pub fn shaders_dir() -> PathBuf

Get the shaders directory path (using XDG convention)

Source

pub fn shader_path(shader_name: &str) -> PathBuf

Get the full path to a shader file If the shader path is absolute, returns it as-is Otherwise, resolves it relative to the shaders directory

Source

pub fn with_dimensions(self, cols: usize, rows: usize) -> Self

Set window dimensions

Source

pub fn with_font_size(self, size: f32) -> Self

Set font size

Source

pub fn with_font_family(self, family: impl Into<String>) -> Self

Set font family

Source

pub fn with_title(self, title: impl Into<String>) -> Self

Set the window title

Source

pub fn with_scrollback(self, size: usize) -> Self

Set the scrollback buffer size

Source

pub fn load_theme(&self) -> Theme

Load theme configuration

Trait Implementations§

Source§

impl Clone for Config

Source§

fn clone(&self) -> Config

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Config

Source§

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

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

impl Default for Config

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Config

Source§

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

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

impl Serialize for Config

Source§

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

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Config

§

impl RefUnwindSafe for Config

§

impl Send for Config

§

impl Sync for Config

§

impl Unpin for Config

§

impl UnwindSafe for Config

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

Source§

fn downcast(&self) -> &T

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> 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<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> NoneValue for T
where T: Default,

Source§

type NoneType = T

Source§

fn null_value() -> T

The none-equivalent value.
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<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

Source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
Source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
Source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
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> 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
Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<T> WasmNotSendSync for T

Source§

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