aboutsummaryrefslogtreecommitdiff
path: root/sh/shrc.d/prompt.sh
diff options
context:
space:
mode:
Diffstat (limited to 'sh/shrc.d/prompt.sh')
-rw-r--r--sh/shrc.d/prompt.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/sh/shrc.d/prompt.sh b/sh/shrc.d/prompt.sh
new file mode 100644
index 00000000..30e4e9d8
--- /dev/null
+++ b/sh/shrc.d/prompt.sh
@@ -0,0 +1,11 @@
+# Some systems' /etc/profile setups export PS1, which really fouls things up
+# when switching between non-login shells; let's put things right by unsetting
+# it to break the export and then just setting them as simple variables
+unset PS1 PS2 PS3 PS4
+PS1='$ ' PS2='> ' PS3='? ' PS4='+ '
+
+# If we have an SSH_CLIENT or SSH_CONNECTION environment variable, put the
+# hostname in PS1 too.
+if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_CONNECTION" ] ; then
+ PS1=$(hostname -s)'$ '
+fi