From 4d8263022d521b48642f983d89a0ee94d4071adf Mon Sep 17 00:00:00 2001 From: Tony Duckles Date: Thu, 24 Jan 2013 23:04:56 -0600 Subject: [PATCH] .bashrc: Add "settitle" function for setting screen title Use the "Set Window Title" escape sequences which GNU screen respects to set the current window title. This could be handy to write scripts to automagically change the window-title, e.g. when ssh'ing to a new machine. --- .bashrc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.bashrc b/.bashrc index 5c99464..3373d6a 100644 --- a/.bashrc +++ b/.bashrc @@ -254,6 +254,11 @@ fi # Alias csh-style "rebash" to bash equivalent alias rehash="hash -r" +# set 'screen' window title +settitle() { + test -n "$STY" && printf "\033k%s\033\\" "$@" +} + # ---------------------------------------------------------------------- # BASH COMPLETION # ---------------------------------------------------------------------- @@ -287,12 +292,6 @@ _expand() { # we always pass these to ls(1) unset LS_COMMON -## OS-specific options -#case "$UNAME" in -# "Linux" ) LS_COMMON="--color=auto";; -# "Cygwin" ) LS_COMMON="--color=auto";; -# "Darwin" ) LS_COMMON="--color=auto";; -#esac # if the dircolors utility is available, set that up for ls dircolors="$(type -P gdircolors dircolors | head -1)" -- 2.43.0