From 0532251aaf9a20e9d69fbd5bb596b170f44fea23 Mon Sep 17 00:00:00 2001 From: Frank LENORMAND Date: Fri, 10 Feb 2017 13:18:11 +0300 Subject: [PATCH] Make sure no ANSI sequences are in the data returned by `man` The Debian implementation of `man-db` does not strip ANSI sequences out of the file, even though the documentation says it would do so. The commit that originally closed this issue wasn't related to the problem experienced, this one hopefully addresses it. This commit also addresses an issue with the `-i` flag in BSD `sed` which expects an argument (the GNU implementation doesn't). Fixes #1098 --- rc/core/doc.kak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rc/core/doc.kak b/rc/core/doc.kak index c1ddb12e..d2d601e0 100644 --- a/rc/core/doc.kak +++ b/rc/core/doc.kak @@ -8,7 +8,7 @@ def -hidden -params 1..2 doc-open %{ export MANWIDTH=${kak_window_width} if man "$1" > "${manout}"; then - sed -ie $(printf 's/.\x8//g') "${manout}" + sed -i "" -e $(printf 's/.\x8//g') -e 's,\x1B\[[0-9;]*[a-zA-Z],,g' "${manout}" printf %s\\n " edit! -scratch '*doc*'