From cd221a21d88dd80232238581ab50cae6878371dd Mon Sep 17 00:00:00 2001 From: Daveanand Mannie Date: Mon, 31 Mar 2025 21:15:41 -0400 Subject: [PATCH] [ADDED] bash like terminal title --- zsh/.zshrc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/zsh/.zshrc b/zsh/.zshrc index 653e048..c017cfd 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -26,8 +26,20 @@ zstyle ':omz:update' mode reminder # just remind me to update when it's time # Uncomment the following line to disable colors in ls. # DISABLE_LS_COLORS="true" -# Uncomment the following line to disable auto-setting terminal title. DISABLE_AUTO_TITLE="true" +function set_title() { + # Check if debian_chroot exists and is readable + if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then + local chroot="${debian_chroot}" + else + local chroot="" + fi + + # Set the terminal title only + print -Pn "\e]0;${chroot:+($chroot)}%n@%m: %~\a" +} +precmd_functions+=(set_title) + # Uncomment the following line to enable command auto-correction. # ENABLE_CORRECTION="true"