aboutsummaryrefslogtreecommitdiff
path: root/module/vulgar/info.scm
blob: 0f55c9424d46098d0dd4e24d529df99827e41a43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
(define-module (vulgar info)
  :use-module ((srfi srfi-1) :select (car+cdr))
  :use-module (srfi srfi-71))

;; Sort-of backwards subprocess call since we want the current terminal to be
;; inherited by stty
(define-public (get-terminal-size)
 (let ((rpipe wpipe (car+cdr (pipe))))
   (system (format #f "stty size > /proc/~s/fd/~s"
                   (getpid) (port->fdes wpipe)))
   (values (read rpipe)
           (read rpipe))))