commander-s/scheme/tty-debug.scm

17 lines
389 B
Scheme
Raw Normal View History

(define *tty-port* #f)
(define (init-tty-debug-output!)
(call-with-values
open-pty
(lambda (input-port name)
(set! *tty-port* (dup->outport input-port))
(set-port-buffering *tty-port* bufpol/none)
name)))
(define debug-message
(lambda args
(with-current-output-port*
*tty-port*
(lambda ()
(for-each display args)
(newline)))))