From 1a01e367f6ecc25c4d6c0a7bcad19e30d06e8f70 Mon Sep 17 00:00:00 2001 From: Gabriella Gonzalez Date: Sat, 29 Mar 2025 18:08:20 -0700 Subject: [PATCH] nixos/bash: Reset title bar when logging out of remote NixOS system This fixes an issue where the title bar is permanently clobbered when you SSH into a remote NixOS system and then log out. The solution is to reset the title bar upon logout. --- nixos/modules/programs/bash/bash.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nixos/modules/programs/bash/bash.nix b/nixos/modules/programs/bash/bash.nix index 6acbea562822..05b41ae619fc 100644 --- a/nixos/modules/programs/bash/bash.nix +++ b/nixos/modules/programs/bash/bash.nix @@ -112,7 +112,14 @@ in }; logout = lib.mkOption { - default = ""; + # Reset the title bar when logging out. This protects against a remote + # NixOS system clobbering your local terminal's title bar when you SSH + # into the remote NixOS system and then log out. + # + # For more details, see: https://superuser.com/a/339946 + default = '' + printf '\e]0;\a' + ''; description = '' Shell script code called during login bash shell logout. '';