diff options
author | Colin Okay <okay@toyful.space> | 2022-03-04 12:46:31 -0600 |
---|---|---|
committer | Colin Okay <okay@toyful.space> | 2022-03-04 12:46:31 -0600 |
commit | bf9daef1280a1e34dca6c23bbf5ccfdbd93ff9ac (patch) | |
tree | 592a50a6d5017d806f3e6ae37168a9d152693e4a /src | |
parent | 924896962c42acf55018521e9f08e5ba4b311903 (diff) |
term width hacking
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.lisp | 10 |
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 |