diff options
| author | Frank LENORMAND <lenormf@gmail.com> | 2017-09-30 08:23:10 +0300 |
|---|---|---|
| committer | Frank LENORMAND <lenormf@gmail.com> | 2017-09-30 08:23:10 +0300 |
| commit | 1cfee17a165120addaed3470d09e5c3cd72fbfe1 (patch) | |
| tree | 646a33bff801b03eed7293b6910f7101343a2c0a | |
| parent | 1e3c3437737819873cfd119bd9f85647daf11290 (diff) | |
rc man/doc: Don't show `groff` warnings
Sometimes the implementation of `man` will display errors, e.g.
```
<standard input>:4808: warning [p 54, 13.2i]: can't break line
```
Those errors are harmless but are still reported on the debug buffer,
so we hide them by redirecting the standard error stream to /dev/null.
| -rw-r--r-- | rc/core/doc.kak | 2 | ||||
| -rw-r--r-- | rc/core/man.kak | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/rc/core/doc.kak b/rc/core/doc.kak index 1dab36c8..5d967f11 100644 --- a/rc/core/doc.kak +++ b/rc/core/doc.kak @@ -8,7 +8,7 @@ def -hidden -params 1..2 doc-open %{ # This option is handled by the `man-db` implementation export MANWIDTH=${kak_window_width} - if man "$1" > "${manout}"; then + if man "$1" > "${manout}" 2>/dev/null; then readonly manout_noescape=$(mktemp "${TMPDIR:-/tmp}"/kak-man-XXXXXX) sed -e $(printf 's/.\x8//g') -e 's,\x1B\[[0-9;]*[a-zA-Z],,g' "${manout}" > "${manout_noescape}" diff --git a/rc/core/man.kak b/rc/core/man.kak index 6533fa68..40388bff 100644 --- a/rc/core/man.kak +++ b/rc/core/man.kak @@ -30,7 +30,7 @@ hook global WinSetOption filetype=(?!man).* %{ def -hidden -params 1..2 man-impl %{ %sh{ manout=$(mktemp "${TMPDIR:-/tmp}"/kak-man-XXXXXX) colout=$(mktemp "${TMPDIR:-/tmp}"/kak-man-XXXXXX) - MANWIDTH=${kak_window_width} man "$@" > $manout + MANWIDTH=${kak_window_width} man "$@" > $manout 2>/dev/null retval=$? col -b -x > ${colout} < ${manout} rm ${manout} |
