aboutsummaryrefslogtreecommitdiff
path: root/module/vulgar/info.scm
blob: 963e20c8789d056a31847de6190e97432be97bb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
(define-module (vulgar info)
  :use-module (hnh util))

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