diff --git a/lib/chibi/term/ansi.scm b/lib/chibi/term/ansi.scm index 39e72b2c..ebde95eb 100644 --- a/lib/chibi/term/ansi.scm +++ b/lib/chibi/term/ansi.scm @@ -389,8 +389,42 @@ ;;> ;;> If ANSI escapes are not enabled, return \var{str}. -(define underline (make-wrap-procedure (underline-escape) - (reset-underline-escape))) +(define underline + (make-wrap-procedure (underline-escape) (reset-underline-escape))) + +;;> Return a string consisting of an ANSI escape code to select +;;> italic style. + +(define italic-escape + (make-simple-escape-procedure 3)) + +;;> Return a string consisting of an ANSI escape code to select +;;> non-italic style. + +(define reset-italic-escape + (make-simple-escape-procedure 23)) + +;;> Returns \var{str} optionally wrapped in italic escapes. + +(define italic + (make-wrap-procedure (italic-escape) (reset-italic-escape))) + +;;> Return a string consisting of an ANSI escape code to select +;;> strikethrough style. + +(define strikethrough-escape + (make-simple-escape-procedure 9)) + +;;> Return a string consisting of an ANSI escape code to select +;;> non-strikethrough style. + +(define reset-strikethrough-escape + (make-simple-escape-procedure 29)) + +;;> Returns \var{str} optionally wrapped in strikethrough escapes. + +(define strikethrough + (make-wrap-procedure (strikethrough-escape) (reset-strikethrough-escape))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/lib/chibi/term/ansi.sld b/lib/chibi/term/ansi.sld index a68d9495..5aa4533e 100644 --- a/lib/chibi/term/ansi.sld +++ b/lib/chibi/term/ansi.sld @@ -24,12 +24,16 @@ bold underline negative + italic + strikethrough rgb rgb-background gray gray-background rgb24 rgb24-background bold-escape reset-bold-escape underline-escape reset-underline-escape negative-escape reset-negative-escape + italic-escape reset-italic-escape + strikethrough-escape reset-strikethrough-escape ansi-escapes-enabled?) (import (scheme base)