diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-12-01 23:46:33 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-12-01 23:46:33 +1300 |
commit | e7722300f9cb3182f9d2101dadc4b34a6dc34e68 (patch) | |
tree | b9a0cedbf755ca148443b59d6c36299448ec2597 /sh/shrc | |
parent | Fix man page filename (diff) | |
download | dotfiles-e7722300f9cb3182f9d2101dadc4b34a6dc34e68.tar.gz dotfiles-e7722300f9cb3182f9d2101dadc4b34a6dc34e68.zip |
setterm(1) isn't as standard as I thought
It's not available on default installs of any of the three major
open-source BSDs, and isn't specified by POSIX. I only noticed this
because the implement of sh(1) in NetBSD 7.0 seems to emit errors from
calls to `command -p` to the terminal, regardless of any redirection of
standard output and error:
$ uname -a
NetBSD faeroes 7.0.1_PATCH NetBSD 7.0.1_PATCH (GENERIC.201607220540Z) amd64
$ command -p setterm
setterm: not found
$ command -p setterm >/dev/null
setterm: not found
$ command -p setterm >/dev/null 2>&1
setterm: not found
Diffstat (limited to 'sh/shrc')
-rw-r--r-- | sh/shrc | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -7,12 +7,14 @@ esac # Don't let anyone write(1) to my terminal command -p mesg n -# Never beep at me -command -p setterm -bfreq -blength 2>/dev/null - # Turn off flow control and control character echo command -p stty -ixon -ctlecho 2>/dev/null +# If setterm(1) is available, tell it never to beep at me +if command -v setterm >/dev/null 2>&1 ; then + setterm -bfreq -blength 2>/dev/null +fi + # Keep around 4K lines of history in memory HISTSIZE=$((1 << 12)) |