Commit 41345fa4e6
41345fa4e6b92411cdeabc935e2c0265155223b9
parent: c010b24c69
Unregistered key
Hanz <hanznathanpo@gmail.com> · 2026-09-05 00:56 UTC
committer: <noreply@github.com>
Add `input_prompt` configuration option for overriding message bar prompt (#610)
Co-authored-by: Ulyssa <git@ulyssa.dev>
Layout: unified · split
config.example.toml
+1
| @@ -11,6 +11,7 @@ default_room = "#iamb-users:0x.badd.cafe" |
| 11 | 11 | default_split = "vertical" |
| 12 | 12 | external_edit_file_suffix = ".md" |
| 13 | 13 | ignorecase = false |
| 14 | input_prompt = "❯ " |
| 14 | 15 | log_level = "warn" |
| 15 | 16 | members_split = "vertical" |
| 16 | 17 | message_shortcode_display = false |
docs/iamb.5
+2
| @@ -166,6 +166,8 @@ Subsection for configuring image previews. See |
| 166 | 166 | for more details. |
| 167 | 167 | .It Sy ignorecase |
| 168 | 168 | Defines whether searches ignore case. Defaults to false. |
| 169 | .It Sy input_prompt |
| 170 | Override the default message bar prompt. |
| 169 | 171 | .It Sy log_level |
| 170 | 172 | Specifies the lowest log level that should be shown. |
| 171 | 173 | Possible values are: |
src/config.rs
+4
| @@ -832,6 +832,7 @@ pub struct TunableValues { |
| 832 | 832 | pub user_gutter_width: usize, |
| 833 | 833 | pub external_edit_file_suffix: String, |
| 834 | 834 | pub tabstop: usize, |
| 835 | pub input_prompt: Option<String>, |
| 835 | 836 | pub members_split: Option<SplitDirection>, |
| 836 | 837 | pub default_split: SplitDirection, |
| 837 | 838 | pub ssl_verify: bool, |
| @@ -883,6 +884,7 @@ pub struct Tunables { |
| 883 | 884 | pub user_gutter_width: Option<usize>, |
| 884 | 885 | pub external_edit_file_suffix: Option<String>, |
| 885 | 886 | pub tabstop: Option<usize>, |
| 887 | pub input_prompt: Option<String>, |
| 886 | 888 | pub members_split: Option<SplitDirection>, |
| 887 | 889 | pub default_split: Option<SplitDirection>, |
| 888 | 890 | pub ssl_verify: Option<bool>, |
| @@ -933,6 +935,7 @@ impl Tunables { |
| 933 | 935 | .external_edit_file_suffix |
| 934 | 936 | .or(other.external_edit_file_suffix), |
| 935 | 937 | tabstop: self.tabstop.or(other.tabstop), |
| 938 | input_prompt: self.input_prompt.or(other.input_prompt), |
| 936 | 939 | members_split: self.members_split.or(other.members_split), |
| 937 | 940 | default_split: self.default_split.or(other.default_split), |
| 938 | 941 | ssl_verify: self.ssl_verify.or(other.ssl_verify), |
| @@ -975,6 +978,7 @@ impl Tunables { |
| 975 | 978 | .external_edit_file_suffix |
| 976 | 979 | .unwrap_or_else(|| ".md".to_string()), |
| 977 | 980 | tabstop: self.tabstop.unwrap_or(4), |
| 981 | input_prompt: self.input_prompt, |
| 978 | 982 | members_split: self.members_split, |
| 979 | 983 | default_split: self.default_split.unwrap_or_default(), |
| 980 | 984 | ssl_verify: self.ssl_verify.unwrap_or(true), |
src/tests.rs
+1
| @@ -170,6 +170,7 @@ pub fn mock_tunables() -> TunableValues { |
| 170 | 170 | ignorecase: false, |
| 171 | 171 | default_room: None, |
| 172 | 172 | encryption: Encryption::default().values(), |
| 173 | input_prompt: None, |
| 173 | 174 | log_level: "warn".into(), |
| 174 | 175 | max_log_files: 7, |
| 175 | 176 | message_shortcode_display: false, |
src/windows/room/chat.rs
+6 −4
| @@ -1177,10 +1177,12 @@ impl StatefulWidget for Chat<'_> { |
| 1177 | 1177 | let encryption_settings = &settings.tunables.encryption; |
| 1178 | 1178 | let encryption_indicator = encryption_settings |
| 1179 | 1179 | .get_indicator(EncryptionIndicatorLocation::PROMPT, state.room().encryption_state()); |
| 1180 | | let prompt = match (self.focused, encryption_indicator) { |
| 1181 | | (false, _) => Span::raw(" "), |
| 1182 | | (true, Some(i)) => i, |
| 1183 | | (true, None) => Span::raw("> "), |
| 1180 | let input_prompt = settings.tunables.input_prompt.as_deref(); |
| 1181 | let prompt = match (self.focused, encryption_indicator, input_prompt) { |
| 1182 | (false, _, _) => Span::raw(" "), |
| 1183 | (true, Some(i), _) => i, |
| 1184 | (true, None, None) => Span::raw("> "), |
| 1185 | (true, None, Some(s)) => Span::raw(s), |
| 1184 | 1186 | }; |
| 1185 | 1187 | |
| 1186 | 1188 | let tbox = TextBox::new().prompt(prompt); |