Skip to content
/ termp Public

Trivial utility: are we in a terminal window or in a dumb one? (like Emacs' Slime)

Notifications You must be signed in to change notification settings

vindarel/termp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Are we running inside a real or a dumb terminal window?

Adapt your logic for the terminal or for Slime.

A small utility that I use in progressons and that I might re-use.

(defvar *termp*) ;  Unbound by default.

(defun termp (&key force)
  "Return T if we run on a terminal.
  This must fail on Slime (on Emacs' default shell prompt) and succeed on a Lisp in a terminal window."
  (if (and (not force)
           (boundp '*termp*))
      *termp*
      (setf *termp* (not (equalp "dumb" (uiop:getenv "TERM"))))))

There is also termp:quit &optional code: quit the Lisp image (uiop:quit) only if we are in a non-dumb terminal. Helps to test scripts.


Installation

This library is on Ultralisp.

Licence

WTFPL

About

Trivial utility: are we in a terminal window or in a dumb one? (like Emacs' Slime)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published