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.

Changed files
+8 -1
nixos
modules
programs
bash
+8 -1
nixos/modules/programs/bash/bash.nix
···
};
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.
'';