Duck tiocgwinsz.
This commit is contained in:
parent
0b23dd6666
commit
fd05ecda88
1 changed files with 6 additions and 2 deletions
|
@ -25,8 +25,11 @@
|
||||||
|
|
||||||
(declare (unit tiocgwinsz))
|
(declare (unit tiocgwinsz))
|
||||||
|
|
||||||
(module
|
(import duck)
|
||||||
|
|
||||||
|
(module*
|
||||||
tiocgwinsz
|
tiocgwinsz
|
||||||
|
#:doc ("TTY terminal size support.")
|
||||||
(
|
(
|
||||||
tiocgwinsz
|
tiocgwinsz
|
||||||
)
|
)
|
||||||
|
@ -50,7 +53,8 @@ if (ioctl(0, TIOCGWINSZ, &wss) == 0) {
|
||||||
"
|
"
|
||||||
))
|
))
|
||||||
|
|
||||||
(define (tiocgwinsz)
|
(define/doc (tiocgwinsz)
|
||||||
|
("Returns the number of terminal rows and columns.")
|
||||||
(let ((res (tiocgwinsz-ioctl)))
|
(let ((res (tiocgwinsz-ioctl)))
|
||||||
(values (bitwise-and res #xffff)
|
(values (bitwise-and res #xffff)
|
||||||
(arithmetic-shift res -16))))
|
(arithmetic-shift res -16))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue