From e88786e12c80117920f4e16ebd42e7f1f8a89b44 Mon Sep 17 00:00:00 2001 From: vaw Date: Thu, 9 Oct 2025 14:05:29 +0200 Subject: [PATCH 1/2] Add config option `set_window_title` --- docs/iamb.5 | 5 +++++ src/config.rs | 4 ++++ src/main.rs | 5 ++++- src/tests.rs | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/iamb.5 b/docs/iamb.5 index 8357f965..e82eb858 100644 --- a/docs/iamb.5 +++ b/docs/iamb.5 @@ -241,6 +241,11 @@ Defaults to 30. .It Sy tabstop Number of spaces that a counts for. Defaults to 4. + +.It Sy set_window_title +Whether to set the title of the terminal window to +.Dq Sy iamb () . +Defaults to true. .El .Ss Example 1: Avoid showing Emojis (useful for terminals w/o support) diff --git a/src/config.rs b/src/config.rs index 635a2959..4dda4f0c 100644 --- a/src/config.rs +++ b/src/config.rs @@ -581,6 +581,7 @@ pub struct TunableValues { pub user_gutter_width: usize, pub external_edit_file_suffix: String, pub tabstop: usize, + pub set_window_title: bool, } #[derive(Clone, Default, Deserialize)] @@ -609,6 +610,7 @@ pub struct Tunables { pub user_gutter_width: Option, pub external_edit_file_suffix: Option, pub tabstop: Option, + pub set_window_title: Option, } impl Tunables { @@ -643,6 +645,7 @@ impl Tunables { .external_edit_file_suffix .or(other.external_edit_file_suffix), tabstop: self.tabstop.or(other.tabstop), + set_window_title: self.set_window_title.or(other.set_window_title), } } @@ -673,6 +676,7 @@ impl Tunables { .external_edit_file_suffix .unwrap_or_else(|| ".md".to_string()), tabstop: self.tabstop.unwrap_or(4), + set_window_title: self.set_window_title.unwrap_or(true), } } } diff --git a/src/main.rs b/src/main.rs index cee2247d..9725d5d0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -985,8 +985,11 @@ fn setup_tty(settings: &ApplicationSettings, enable_enhanced_keys: bool) -> std: if settings.tunables.mouse.enabled { crossterm::execute!(stdout(), EnableMouseCapture)?; } + if settings.tunables.set_window_title { + crossterm::execute!(stdout(), SetTitle(title))?; + } - crossterm::execute!(stdout(), EnableBracketedPaste, EnableFocusChange, SetTitle(title)) + crossterm::execute!(stdout(), EnableBracketedPaste, EnableFocusChange) } // Do our best to reverse what we did in setup_tty() when we exit or crash. diff --git a/src/tests.rs b/src/tests.rs index 4a31d649..e56ca059 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -201,6 +201,7 @@ pub fn mock_tunables() -> TunableValues { image_preview: None, user_gutter_width: 30, tabstop: 4, + set_window_title: true, } } From abb870786a0cec05c01a4205d47ab07783b650be Mon Sep 17 00:00:00 2001 From: vaw Date: Sun, 12 Oct 2025 16:15:50 +0200 Subject: [PATCH 2/2] manpage: Sort `settings` alphabetically --- docs/iamb.5 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/iamb.5 b/docs/iamb.5 index e82eb858..dca2caaa 100644 --- a/docs/iamb.5 +++ b/docs/iamb.5 @@ -125,14 +125,14 @@ key and can be overridden as described in .Sx PROFILES . .Bl -tag -width Ds -.It Sy external_edit_file_suffix -Suffix to append to temporary file names when using the :editor command. Defaults to .md. - .It Sy default_room The room to show by default instead of the .Sy :welcome window. +.It Sy external_edit_file_suffix +Suffix to append to temporary file names when using the :editor command. Defaults to .md. + .It Sy image_preview Enable image previews and configure it. An empty object will enable the feature with default settings, omitting it will disable the feature. @@ -238,14 +238,14 @@ Specify the width of the column where usernames are displayed in a room. Usernames that are too long are truncated. Defaults to 30. -.It Sy tabstop -Number of spaces that a counts for. -Defaults to 4. - .It Sy set_window_title Whether to set the title of the terminal window to .Dq Sy iamb () . Defaults to true. + +.It Sy tabstop +Number of spaces that a counts for. +Defaults to 4. .El .Ss Example 1: Avoid showing Emojis (useful for terminals w/o support)