aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib.lisp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lib.lisp b/src/lib.lisp
index 1ddb103..070e021 100644
--- a/src/lib.lisp
+++ b/src/lib.lisp
@@ -520,12 +520,15 @@ the directories that appear in the value of that variable."
(print results output))
(merge-into-cache results))
-(defvar *term-width* 80)
+(defvar *term-width* nil)
(defun set-term-width ()
+ ;; tput cols b/c getenv COLUMNS wasnt working on some terminals
(setf *term-width*
- (or (parse-integer (uiop:run-program '("tput" "cols") :output :string) :junk-allowed t)
- 80)))
+ (-
+ (or (parse-integer (uiop:run-program '("tput" "cols") :output :string) :junk-allowed t)
+ 80)
+ 4)))
(defun print-oneliner-result-for-user (oneliner)
(let* ((title-line-format-str
@@ -582,6 +585,7 @@ the directories that appear in the value of that variable."
(defun search-for-oneliners (terms limit not-flagged-p)
(assert (loop for term in terms never (find #\, term) ))
(set-term-width)
+ (format t "TERM WIDTH IS ~a~%" *term-width*)
(ensure-config)
(let ((response
(api:request-with