From b8f1df6458f5330ca1c1da0e8cfcebe41f2baf6e Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 25 Jan 2021 17:09:59 +1100 Subject: [PATCH] Fix man for systems lacking the col command At least Alpine linux with mandoc does not have the col command, as it is easy to emulate with sed, fallback onto it when it does not exist. --- rc/tools/man.kak | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rc/tools/man.kak b/rc/tools/man.kak index ecf237bd..5e57dc06 100644 --- a/rc/tools/man.kak +++ b/rc/tools/man.kak @@ -38,8 +38,13 @@ define-command -hidden -params ..3 man-impl %{ evaluate-commands %sh{ colout=$(mktemp "${TMPDIR:-/tmp}"/kak-man.XXXXXX) env MANWIDTH=${kak_window_range##* } man "$@" > "$manout" 2> "$manerr" retval=$? - col -b -x > ${colout} < ${manout} + if command -v col >/dev/null; then + col -b -x > ${colout} < ${manout} + else + sed 's/.//g' > ${colout} < ${manout} + fi rm ${manout} + if [ "${retval}" -eq 0 ]; then printf %s\\n " edit -scratch %{*$buffer_name ${*}*}