Add terminal.terminalWidth and supporting types/calls.
This commit is contained in:
parent
0cb90f3eaf
commit
19f83ccd0b
2 changed files with 54 additions and 1 deletions
|
|
@ -259,3 +259,13 @@ proc tcFlow*(fd: cint; action: cint): cint {.importc: "tcflow",
|
|||
# Get process group ID for session leader for controlling terminal FD.
|
||||
|
||||
proc tcGetSid*(fd: cint): Pid {.importc: "tcgetsid", header: "<termios.h>".}
|
||||
|
||||
# Window size ioctl. Should work on on any Unix that xterm has been ported to.
|
||||
var TIOCGWINSZ*{.importc, header: "<sys/ioctl.h>".}: culong
|
||||
|
||||
type ioctl_winsize* {.importc: "struct winsize", header: "<termios.h>",
|
||||
final, pure.} = object
|
||||
ws_row*, ws_col*, ws_xpixel*, ws_ypixel*: cushort
|
||||
|
||||
proc ioctl*(fd: cint, request: culong, reply: ptr ioctl_winsize): int {.
|
||||
importc: "ioctl", header: "<stdio.h>", varargs.}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue