Skip to content

Commit dfc560a

Browse files
authored
Fix: Exit less if an interrupt character is typed (#704)
Signed-off-by: Alexander Dahmen <alexander.dahmen@inovex.de>
1 parent 22dfa06 commit dfc560a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/pkg/print/print.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ func (p *Printer) PagerDisplay(content string) error {
189189
// -S: disables line wrapping
190190
// -w: highlight the first line after moving one full page down
191191
// -R: interprets ANSI color and style sequences
192-
pagerCmd := exec.Command("less", "-F", "-S", "-w", "-R")
192+
// -K: exits if an interrupt character is typed
193+
pagerCmd := exec.Command("less", "-F", "-S", "-w", "-R", "-K")
193194

194195
pager, pagerExists := os.LookupEnv("PAGER")
195196
if pagerExists && pager != "nil" && pager != "" {

0 commit comments

Comments
 (0)