From 930325eeeedf3a339fa9c91178a659eed74c9e73 Mon Sep 17 00:00:00 2001 From: Alexander Dahmen Date: Thu, 24 Apr 2025 10:14:52 +0200 Subject: [PATCH] Fix: Exit less if an interrupt character is typed Signed-off-by: Alexander Dahmen --- internal/pkg/print/print.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/pkg/print/print.go b/internal/pkg/print/print.go index 470fb49ac..63f48fe89 100644 --- a/internal/pkg/print/print.go +++ b/internal/pkg/print/print.go @@ -189,7 +189,8 @@ func (p *Printer) PagerDisplay(content string) error { // -S: disables line wrapping // -w: highlight the first line after moving one full page down // -R: interprets ANSI color and style sequences - pagerCmd := exec.Command("less", "-F", "-S", "-w", "-R") + // -K: exits if an interrupt character is typed + pagerCmd := exec.Command("less", "-F", "-S", "-w", "-R", "-K") pager, pagerExists := os.LookupEnv("PAGER") if pagerExists && pager != "nil" && pager != "" {