fix(cli): don't auto-invoke pager under powershell

Need to find a pager that works on Windows.
This commit is contained in:
Henrik Lissner 2024-09-07 04:03:02 -04:00
parent 94a291a7f8
commit 73ab554566
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -1322,6 +1322,8 @@ ARGS are options passed to less. If DOOMPAGER is set, ARGS are ignored."
ARGS are options passed to less. If DOOMPAGER is set, ARGS are ignored." ARGS are options passed to less. If DOOMPAGER is set, ARGS are ignored."
(doom-cli--exit (doom-cli--exit
(if (equal (getenv "__DOOMSH") "ps1")
0
(let ((threshold (ceiling (* (doom-cli-context-height context) (let ((threshold (ceiling (* (doom-cli-context-height context)
doom-cli-pager-ratio)))) doom-cli-pager-ratio))))
(if (>= (let ((stdout (doom-cli-context-stdout context))) (if (>= (let ((stdout (doom-cli-context-stdout context)))
@ -1331,7 +1333,7 @@ ARGS are options passed to less. If DOOMPAGER is set, ARGS are ignored."
(count-lines (point-min) (point-max))))) (count-lines (point-min) (point-max)))))
threshold) threshold)
(cons :pager args) (cons :pager args)
0)) 0)))
context)) context))
;; (defun doom-cli--exit-editor (args context)) ; TODO Launch $EDITOR ;; (defun doom-cli--exit-editor (args context)) ; TODO Launch $EDITOR