From 0934b3f7668a629b09c5bdb9f51747a20ef04eaf Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 19 Sep 2020 16:29:05 +0300 Subject: feat(bashrc): set window title to hostname and cwd --- bashrc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'bashrc') diff --git a/bashrc b/bashrc index cae83f0..0a389b1 100644 --- a/bashrc +++ b/bashrc @@ -156,6 +156,13 @@ define_ps1() } +define_window_title() +{ + printf "%s:" "$(hostname)" + pwd | sed "s,$HOME,~," +} + + tell_about_exit_code() { local exit_code="$1" @@ -172,7 +179,7 @@ export PROMPT_COMMAND=prompt_command prompt_command() { tell_about_exit_code "$?" PS1="$(define_ps1)" - set_window_title "Terminal" + set_window_title "$(define_window_title)" } -- cgit v1.2.1