aboutsummaryrefslogtreecommitdiff
path: root/sh/shrc
blob: c3e300ea126e20ebb2a7ba406a380fd281780355 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Don't let anyone write(1) to my terminal
command -p mesg n

# Turn off flow control and control character echo
command -p stty -ixon -ctlecho 2>/dev/null

# Keep around 4K lines of history in memory
HISTSIZE=$((1 << 12))

# If HOSTNAME isn't set by this shell, we'll do it
[ -n "$HOSTNAME" ] || HOSTNAME=$(uname -n)

# Don't warn me about new mail
unset -v MAILCHECK

# 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='+ '

# Load all the POSIX-compatible functions from ~/.shrc.d; more advanced shells
# like bash will have their own functions
for sh in "$HOME"/.shrc.d/*.sh ; do
    [ -e "$sh" ] && . "$sh"
done
unset -v sh

# If ENV_EXT was set and exists, source that too
[ -e "$ENV_EXT" ] && . "$ENV_EXT"