-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
charms/ll:has_colors is charms/ll:FALSE on a truecolor terminal #64
Comments
I can reproduce with this code: https://stackoverflow.com/questions/77614661/getting-your-terminal-does-not-support-color-error-in-common-lisp-cl-charms There's a preliminary check: (defun start-color ()
(when (eql (charms/ll:has-colors) charms/ll:FALSE)
(error "Your terminal does not support color."))
(let ((ret-code (charms/ll:start-color)))
(if (= ret-code 0)
T
(error "start-color error ~s." ret-code)))) which errors out. If I replace its call in the main function by libncurses5 v6.2, SBCL 2.1.5, cl-charms from quicklisp "2023-02-15". |
I also had this issue, (following the same tutorial as all you) -- I had a look at what the LEM project is doing, and their code works fine.
(defmacro define-color-pair ((name pair) foreground background)
`(progn
(start-color)
(defparameter ,name (progn (charms/ll:init-pair ,pair ,foreground ,background)
(charms/ll:color-pair ,pair))))) Move the (defun main ()
(charms:with-curses ()
(charms:disable-echoing)
(charms:enable-raw-input :interpret-control-characters t)
(charms:enable-non-blocking-mode charms:*standard-window*)
; here is where i define my color pairs
(define-color-pair (+white/blue+ 1) +white+ +blue+)
(define-color-pair (+black/red+ 2) +black+ +red+)
(define-color-pair (+green/black+ 3) +green+ +black+)
(loop :named driver-loop
....other forms))) |
When I use <curses.h> in a C program, has_colors() is true.
When following along the charms crash course linked in the README,
charms/ll:has_colors is charms/ll:FALSE on my terminal (kitty).
Removing the test indeed lead to a situation in which the code written in the article doesn't display any color.
The text was updated successfully, but these errors were encountered: