From 505f760df925ce175f760b595e6ce08ec62368cb Mon Sep 17 00:00:00 2001 From: Harald Gutmann Date: Sat, 8 Oct 2022 19:55:52 +0200 Subject: [PATCH] fix(clap): Early line wrap ascii control chars counting ascii control sequences lead to unpredictable and early line breaks on colorized inputs (e.g. syntax highlighted strings) --- src/output/textwrap/core.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/output/textwrap/core.rs b/src/output/textwrap/core.rs index f271ca08..b890c6c7 100644 --- a/src/output/textwrap/core.rs +++ b/src/output/textwrap/core.rs @@ -63,6 +63,7 @@ pub(crate) fn display_width(text: &str) -> usize { control_sequence = true; } else if control_sequence && ch == control_terminate { control_sequence = false; + continue; } if !control_sequence {