aboutsummaryrefslogtreecommitdiff
path: root/sh/shrc.d
diff options
context:
space:
mode:
Diffstat (limited to 'sh/shrc.d')
-rw-r--r--sh/shrc.d/gdb.sh2
-rw-r--r--sh/shrc.d/ls.sh10
-rw-r--r--sh/shrc.d/pd.sh2
-rw-r--r--sh/shrc.d/prompt.sh7
-rw-r--r--sh/shrc.d/rd.sh1
-rw-r--r--sh/shrc.d/sd.sh1
-rw-r--r--sh/shrc.d/which.sh2
-rw-r--r--sh/shrc.d/x.sh7
8 files changed, 8 insertions, 24 deletions
diff --git a/sh/shrc.d/gdb.sh b/sh/shrc.d/gdb.sh
index ec9d4137..4fb459cb 100644
--- a/sh/shrc.d/gdb.sh
+++ b/sh/shrc.d/gdb.sh
@@ -1,4 +1,4 @@
# Don't print the GDB copyright message on every invocation
gdb() {
- command gdb -q "$@"
+ command gdb --quiet "$@"
}
diff --git a/sh/shrc.d/ls.sh b/sh/shrc.d/ls.sh
index c6558fc3..6fbfbf61 100644
--- a/sh/shrc.d/ls.sh
+++ b/sh/shrc.d/ls.sh
@@ -41,16 +41,6 @@ ls() {
set -- --time-style='+%Y-%m-%d %H:%M:%S' "$@"
fi
- # If the operating system is FreeBSD, there are some specific options we
- # can add that might mean different things to e.g. GNU ls(1)
- case $OS in
- FreeBSD)
- # -D: Timestamp format
- # -G: Use color
- set -- -D '%Y-%m-%d %H:%M:%S' -G "$@"
- ;;
- esac
-
# Run ls(1) with the concluded arguments
command ls "$@"
}
diff --git a/sh/shrc.d/pd.sh b/sh/shrc.d/pd.sh
index 77f6bae9..e99049d3 100644
--- a/sh/shrc.d/pd.sh
+++ b/sh/shrc.d/pd.sh
@@ -2,8 +2,6 @@
# use when you've got a file path in a variable, or in history, or in Alt+.,
# and want to quickly move to its containing directory. In the absence of an
# argument, this just shifts up a directory, i.e. `cd ..`
-#
-# Note this is equivalent to `ud 1`.
pd() {
# Check arguments; default to $PWD
diff --git a/sh/shrc.d/prompt.sh b/sh/shrc.d/prompt.sh
index cb32c113..72cf59b6 100644
--- a/sh/shrc.d/prompt.sh
+++ b/sh/shrc.d/prompt.sh
@@ -11,8 +11,7 @@ PS3='? '
unset PS4
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)'$ '
+# Prompt has hostname via SSH outside of screen/tmux
+if [ -n "$SSH_CLIENT" ] && [ -z "$STY" ] && [ -z "$TMUX" ] ; then
+ PS1=$(hostname -s)$PS1
fi
diff --git a/sh/shrc.d/rd.sh b/sh/shrc.d/rd.sh
index e6d761a6..3e1b4d9c 100644
--- a/sh/shrc.d/rd.sh
+++ b/sh/shrc.d/rd.sh
@@ -11,6 +11,7 @@
# $ rd usr opt
# $ pwd
# /opt/bin
+#
rd() {
# Check argument count
diff --git a/sh/shrc.d/sd.sh b/sh/shrc.d/sd.sh
index 10597832..1fe748c4 100644
--- a/sh/shrc.d/sd.sh
+++ b/sh/shrc.d/sd.sh
@@ -30,6 +30,7 @@
# /tmp/tmp.ZSunna5Eup/a
#
# Seems to work for symbolic links.
+#
sd() {
# Check argument count
diff --git a/sh/shrc.d/which.sh b/sh/shrc.d/which.sh
index 9d8c899a..528e5048 100644
--- a/sh/shrc.d/which.sh
+++ b/sh/shrc.d/which.sh
@@ -1,3 +1,5 @@
+# Try to stop me using the non-standard `which`:
+# <http://mywiki.wooledge.org/BadUtils#which>
which() {
printf >&2 'Whichcraft detected! Did you mean: command -v %s\n' "$*"
return 2
diff --git a/sh/shrc.d/x.sh b/sh/shrc.d/x.sh
deleted file mode 100644
index ed921c68..00000000
--- a/sh/shrc.d/x.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-# Most systems won't have X, so we'll only define this if we have startx(1)
-command -v startx >/dev/null 2>&1 || return
-
-# Quick one-key command to launch an X session
-x() {
- exec startx "$@"
-}