aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-06-14 02:43:45 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-06-14 03:47:07 +0300
commitfbd20ad6e488fb3b9efc1612fdffee6e672976c1 (patch)
treed21daf93241786f8aa6fde23b41cdb9e15182b79 /src/client
parentd35c642ef36ee5ac2afe7c1b18ad5a717bc807d8 (diff)
feat: add plugin v1 system
Add manifest-driven plugin actions, event hooks, pane entrypoints, link handlers, and host APIs. Support plugin link, GitHub install, build commands, installed plugin registry, pane movement, runtime context, and plugin docs.
Diffstat (limited to 'src/client')
-rw-r--r--src/client/mod.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/client/mod.rs b/src/client/mod.rs
index e4daf82d..b7fd212d 100644
--- a/src/client/mod.rs
+++ b/src/client/mod.rs
@@ -984,6 +984,10 @@ async fn run_client_loop(
forward_clipboard(&data);
let _ = io::stdout().flush();
}
+ ServerMessage::WindowTitle { title } => {
+ write_window_title(title.as_deref());
+ let _ = io::stdout().flush();
+ }
ServerMessage::ReloadSoundConfig => {
reload_local_client_config(
&mut state.sound_config,
@@ -1208,6 +1212,19 @@ fn forward_clipboard(data: &str) {
crate::selection::write_osc52_bytes(&bytes);
}
+fn window_title_osc(title: Option<&str>) -> Vec<u8> {
+ let title = title.unwrap_or("herdr");
+ let safe_title = title
+ .chars()
+ .filter(|ch| !matches!(*ch, '\u{1b}' | '\u{7}' | '\u{9c}'))
+ .collect::<String>();
+ format!("\x1b]0;{safe_title}\x07").into_bytes()
+}
+
+fn write_window_title(title: Option<&str>) {
+ let _ = io::stdout().write_all(&window_title_osc(title));
+}
+
// ---------------------------------------------------------------------------
// Frame output
// ---------------------------------------------------------------------------
@@ -1905,4 +1922,13 @@ mod tests {
std::env::remove_var("SSH_CONNECTION");
}
}
+
+ #[test]
+ fn window_title_osc_strips_terminators_and_defaults_to_herdr() {
+ assert_eq!(
+ window_title_osc(Some("herdr\x1b api\u{7}\u{9c}")),
+ b"\x1b]0;herdr api\x07"
+ );
+ assert_eq!(window_title_osc(None), b"\x1b]0;herdr\x07");
+ }
}