File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 4
4
"bufio"
5
5
"errors"
6
6
"fmt"
7
+ "runtime"
7
8
8
9
"log/slog"
9
10
"os"
@@ -163,13 +164,17 @@ func (p *Printer) PagerDisplay(content string) error {
163
164
if outputFormat == NoneOutputFormat {
164
165
return nil
165
166
}
166
- lessCmd := exec .Command ("less" , "-F" , "-S" , "-w" )
167
- lessCmd .Stdin = strings .NewReader (content )
168
- lessCmd .Stdout = p .Cmd .OutOrStdout ()
167
+ pagerCmd := exec .Command ("less" , "-F" , "-S" , "-w" )
168
+ if runtime .GOOS == "windows" {
169
+ pagerCmd = exec .Command ("more" )
170
+ }
171
+
172
+ pagerCmd .Stdin = strings .NewReader (content )
173
+ pagerCmd .Stdout = p .Cmd .OutOrStdout ()
169
174
170
- err := lessCmd .Run ()
175
+ err := pagerCmd .Run ()
171
176
if err != nil {
172
- p .Debug (ErrorLevel , "run less command: %v" , err )
177
+ p .Debug (ErrorLevel , "run pager command: %v" , err )
173
178
p .Outputln (content )
174
179
}
175
180
return nil
You can’t perform that action at this time.
0 commit comments