diff options
Diffstat (limited to 'bash')
-rw-r--r-- | bash/bashrc.d/ed.bash | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/bash/bashrc.d/ed.bash b/bash/bashrc.d/ed.bash index 1a7a2b63..5a54c761 100644 --- a/bash/bashrc.d/ed.bash +++ b/bash/bashrc.d/ed.bash @@ -1,9 +1,13 @@ # Add a colon prompt to ed when a command is expected rather than text; makes # it feel a lot more like using ex. Only do this when stdin is a terminal, -# however. +# however. Also try and use -v for more verbose error output. ed() { if [[ -t 0 ]] ; then - command ed -p: "$@" + if ed -sv - </dev/null >/dev/null 2>&1 ; then + command ed -vp: "$@" + else + command ed -p: "$@" + fi else command ed "$@" fi |