summaryrefslogtreecommitdiff
path: root/bashrc
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2020-09-19 16:29:05 +0300
committerLars Wirzenius <liw@liw.fi>2020-09-19 16:29:05 +0300
commit0934b3f7668a629b09c5bdb9f51747a20ef04eaf (patch)
treed6e06a80f8a72a253d49959401fc03378aa1e3b3 /bashrc
parent0b3e8219974b237fdc35838154a3a39043ea37c7 (diff)
downloadliw-dot-files-0934b3f7668a629b09c5bdb9f51747a20ef04eaf.tar.gz
feat(bashrc): set window title to hostname and cwd
Diffstat (limited to 'bashrc')
-rw-r--r--bashrc9
1 files changed, 8 insertions, 1 deletions
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)"
}