Renamed "reverse" to "invert"

This commit is contained in:
Vivianne 2024-02-11 14:06:38 -05:00
parent 10489b1b08
commit 09083afe11
4 changed files with 8 additions and 14 deletions

View file

@ -13,7 +13,7 @@
underline
overline
blink
reverse
invert
cross-out))
(define %RESET "0")
@ -85,7 +85,7 @@
(define (underline . s) (cons-seq s %UNDERLINE))
(define (overline . s) (cons-seq s %OVERLINE))
(define (blink . s) (cons-seq s %BLINK))
(define (reverse . s) (cons-seq s %REVERSE))
(define (invert . s) (cons-seq s %REVERSE))
(define (cross-out . s) (cons-seq s %CROSS-OUT))
(define (foreground c . s) (cons-seq s (make-foreground c)))
(define (background c . s) (cons-seq s (make-background c)))

View file

@ -1,20 +1,19 @@
(define-module (termenv unix)
#:use-module (srfi srfi-98)
#:export (color-profile))
(define (color-profile port)
"Get the best color profile supported by the given output port"
(cond
((not (isatty? port)) 'ascii)
((equal? "true" (get-environment-variable "GOOGLE_CLOUD_SHELL")) 'true-color)
(else (let ((term (or (get-environment-variable "TERM") ""))
(color-term (or (get-environment-variable "COLORTERM") "")))
((equal? "true" (getenv "GOOGLE_CLOUD_SHELL")) 'true-color)
(else (let ((term (or (getenv "TERM") ""))
(color-term (or (getenv "COLORTERM") "")))
(cond
((or (string-ci=? color-term "24bit")
(string-ci=? color-term "truecolor"))
;; tmux supports TrueColor, screen only ANSI256
(if (and (string-prefix-ci? "screen" term)
(not (string-ci=? "tmux" (or (get-environment-variable "TERM_PROGRAM") ""))))
(not (string-ci=? "tmux" (or (getenv "TERM_PROGRAM") ""))))
'ansi256
'true-color))
((or (string-ci=? color-term "yes")

View file

@ -2,9 +2,7 @@
#:use-module (termenv screen)
#:use-module (tests utils)
#:use-module (srfi srfi-64)
#:use-module (rnrs io ports)
#:use-module (scheme base)
#:use-module (ice-9 textual-ports))
#:use-module (rnrs io ports))
(test-begin "test-screen")
@ -12,5 +10,4 @@
"\x1b[0m"
(reset (current-output-port)))
(test-end "test-screen")

View file

@ -2,9 +2,7 @@
#:use-module (termenv style)
#:use-module (tests utils)
#:use-module (srfi srfi-64)
#:use-module (rnrs io ports)
#:use-module (scheme base)
#:use-module (ice-9 textual-ports))
#:use-module (rnrs io ports))
(test-begin "test-style")