Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions docs/iamb.5
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -238,6 +238,11 @@ 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 set_window_title
Whether to set the title of the terminal window to
.Dq Sy iamb (<user_id>) .
Defaults to true.

.It Sy tabstop
Number of spaces that a <Tab> counts for.
Defaults to 4.
Expand Down
4 changes: 4 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down Expand Up @@ -609,6 +610,7 @@ pub struct Tunables {
pub user_gutter_width: Option<usize>,
pub external_edit_file_suffix: Option<String>,
pub tabstop: Option<usize>,
pub set_window_title: Option<bool>,
}

impl Tunables {
Expand Down Expand Up @@ -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),
}
}

Expand Down Expand Up @@ -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),
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ pub fn mock_tunables() -> TunableValues {
image_preview: None,
user_gutter_width: 30,
tabstop: 4,
set_window_title: true,
}
}

Expand Down
Loading