Skip to content

A modern terminal with a built-in multiplexer: close it and your sessions keep running. Run shells and tons of AI agents across your machines, then pick them up from desktop, browser, TUI and more. Written in Rust with no UI framework: interface drawn straight on the GPU. No Electron, GPUI or webview.

Play notification sounds regardless of active workspace

RoversXcc1a2777e69e
diff --git a/wezterm-gui/i18n/en-US.ftl b/wezterm-gui/i18n/en-US.ftl
index 2b277ce5..f6247350 100644
--- a/wezterm-gui/i18n/en-US.ftl
+++ b/wezterm-gui/i18n/en-US.ftl
@@ -92,7 +92,7 @@ settings-remote-drop-destination = Remote Drop Destination
settings-remote-drop-destination-description = Where files dropped onto a remote terminal are uploaded. Use cwd for the shell's current directory.
settings-notifications-heading = Notifications
settings-notification-sounds = Notification Sounds
-settings-notification-sounds-description = Play a short sound when a thread you are not watching finishes, or starts waiting on you.
+settings-notification-sounds-description = Play a short sound when a thread finishes or starts waiting on you.
settings-terminal-heading = Effective terminal config
settings-terminal-font-size = Font Size
settings-terminal-font-size-description = Current effective value from the WezTerm-compatible config.
diff --git a/wezterm-gui/i18n/fr-FR.ftl b/wezterm-gui/i18n/fr-FR.ftl
index 274605aa..f086f3b8 100644
--- a/wezterm-gui/i18n/fr-FR.ftl
+++ b/wezterm-gui/i18n/fr-FR.ftl
@@ -92,7 +92,7 @@ settings-remote-drop-destination = Destination du dépôt distant
settings-remote-drop-destination-description = Emplacement d’envoi des fichiers déposés sur un terminal distant. Utilisez cwd pour le dossier courant du shell.
settings-notifications-heading = Notifications
settings-notification-sounds = Sons de notification
-settings-notification-sounds-description = Émettre un son bref lorsqu’un fil que vous ne regardez pas se termine ou attend une réponse.
+settings-notification-sounds-description = Émettre un son bref lorsqu’un fil se termine ou attend une réponse.
settings-terminal-heading = Configuration effective du terminal
settings-terminal-font-size = Taille de police
settings-terminal-font-size-description = Valeur effective actuelle issue de la configuration compatible WezTerm.
diff --git a/wezterm-gui/i18n/ja-JP.ftl b/wezterm-gui/i18n/ja-JP.ftl
index 005561b5..021a31cf 100644
--- a/wezterm-gui/i18n/ja-JP.ftl
+++ b/wezterm-gui/i18n/ja-JP.ftl
@@ -92,7 +92,7 @@ settings-remote-drop-destination = リモートへのドロップ先
settings-remote-drop-destination-description = リモートターミナルへドロップしたファイルのアップロード先です。cwd でシェルの現在のディレクトリを指定できます。
settings-notifications-heading = 通知
settings-notification-sounds = 通知音
-settings-notification-sounds-description = 見ていないスレッドが完了したとき、または入力待ちになったときに短い音を鳴らします。
+settings-notification-sounds-description = スレッドが完了したとき、または入力待ちになったときに短い音を鳴らします。
settings-terminal-heading = 有効なターミナル設定
settings-terminal-font-size = フォントサイズ
settings-terminal-font-size-description = WezTerm 互換設定から得た現在の有効値です。
diff --git a/wezterm-gui/i18n/zh-CN.ftl b/wezterm-gui/i18n/zh-CN.ftl
index 35178056..60e085df 100644
--- a/wezterm-gui/i18n/zh-CN.ftl
+++ b/wezterm-gui/i18n/zh-CN.ftl
@@ -92,7 +92,7 @@ settings-remote-drop-destination = 远程拖放目标
settings-remote-drop-destination-description = 拖到远程终端的文件上传位置。使用 cwd 表示 shell 当前目录。
settings-notifications-heading = 通知
settings-notification-sounds = 提示音
-settings-notification-sounds-description = 当你没在看的 thread 干完了、或者开始等你输入时,响一声。
+settings-notification-sounds-description = Thread 完成或者开始等待你输入时,响一声。
settings-terminal-heading = 当前终端配置
settings-terminal-font-size = 字号
settings-terminal-font-size-description = WezTerm 兼容配置中的当前有效值。
diff --git a/wezterm-gui/src/workspace_threads.rs b/wezterm-gui/src/workspace_threads.rs
index 76ac0734..0fc3a8cf 100644
--- a/wezterm-gui/src/workspace_threads.rs
+++ b/wezterm-gui/src/workspace_threads.rs
@@ -1509,26 +1509,13 @@ static NEEDS_INPUT_WAV: &[u8] = include_bytes!("../../assets/sounds/needs-input.
/// business making noise, and neither does a machine someone is presenting on.
const DISABLE_SOUND_ENV: &str = "THINKTERM_DISABLE_SOUND";
-/// Whether a transition is worth a sound, given what the user is already
-/// looking at.
-///
-/// Watching the thread that just finished means the news arrived by eye
-/// already, and a sound on top of that is just noise. Everything else happened
-/// out of sight, which is the entire point of the feature.
-fn should_announce(changed_workspace: &str, active_workspace: &str) -> bool {
- changed_workspace != active_workspace
-}
-
-fn announce_work(workspace: &str, announcement: WorkAnnouncement) {
+fn announce_work(announcement: WorkAnnouncement) {
if std::env::var_os(DISABLE_SOUND_ENV).is_some() {
return;
}
if !crate::native_settings::notification_sounds_enabled() {
return;
}
- if !should_announce(workspace, &Mux::get().active_workspace()) {
- return;
- }
let wav = match announcement {
WorkAnnouncement::Finished => DONE_WAV,
WorkAnnouncement::NeedsInput => NEEDS_INPUT_WAV,
@@ -1554,7 +1541,7 @@ pub fn refresh_thread_work_for_workspace(workspace: &str) -> bool {
change
};
if let Some(announcement) = change.announce {
- announce_work(workspace, announcement);
+ announce_work(announcement);
}
if change.should_persist {
schedule_workspace_thread_store_persist();
@@ -7181,14 +7168,6 @@ mod tests {
);
}
- /// A sound for the thread already on screen is noise: the news arrived by
- /// eye before it could arrive by ear.
- #[test]
- fn the_workspace_being_watched_stays_silent() {
- assert!(!should_announce("workspace-1", "workspace-1"));
- assert!(should_announce("workspace-1", "workspace-2"));
- }
-
#[test]
fn pending_notifications_list_attention_first_and_skip_idle_running() {
let mut store = test_store();