From 5f0ef50077002f0308fc45f7d0a01a508c970516 Mon Sep 17 00:00:00 2001 From: Jade Lovelace Date: Wed, 31 Jul 2024 22:06:18 -0700 Subject: cli: eat terminal codes from stdout also This *should* be sound, plus or minus the amount that the terminal code eating code is messed up already. This is useful for testing CLI output because it will strip the escapes enough to just shove the expected output in a file. Change-Id: I8a9b58fafb918466ac76e9ab585fc32fb9294819 --- src/libutil/terminal.hh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/libutil/terminal.hh') diff --git a/src/libutil/terminal.hh b/src/libutil/terminal.hh index 6b8d59182..2c422ecff 100644 --- a/src/libutil/terminal.hh +++ b/src/libutil/terminal.hh @@ -30,7 +30,8 @@ bool shouldANSI(); */ std::string filterANSIEscapes(std::string_view s, bool filterAll = false, - unsigned int width = std::numeric_limits::max()); + unsigned int width = std::numeric_limits::max(), + bool eatTabs = true); /** * Recalculate the window size, updating a global variable. Used in the -- cgit v1.2.3