From efe504eefc3775d2967b44bed787b3a5e6bfc51d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Tue, 27 Sep 2022 19:50:05 +0200 Subject: [PATCH] Fix color output for non-256 color terminals The function enableVirtualTerminalProcessing must return an error if virtual terminal processing (only applicable on Windows) was not enabled, otherwise we assume that the terminal supports both 256-color and truecolor. We have been erroneously assuming that all non-Windows terminals are 256-color and sending escape sequences to those that cannot intepret them. This led to some parts of Survey prompts being invisible on old terminals. Regressed in be4b392530fc5a8f6529b38a0d3a1d478fb12b0b --- pkg/iostreams/console.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/iostreams/console.go b/pkg/iostreams/console.go index 1eef4190b..73126787d 100644 --- a/pkg/iostreams/console.go +++ b/pkg/iostreams/console.go @@ -3,6 +3,8 @@ package iostreams +import "errors" + func enableVirtualTerminalProcessing(fd uintptr) error { - return nil + return errors.New("not implemented") }