Oops - L_ctermid must be a global var to compile.
This commit is contained in:
parent
19f83ccd0b
commit
7b73a94afc
1 changed files with 2 additions and 2 deletions
|
|
@ -162,11 +162,11 @@ else:
|
||||||
return int(win.ws_col)
|
return int(win.ws_col)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
var L_ctermid{.importc, header: "<stdio.h>".}: cint
|
||||||
proc terminalWidth*(): int =
|
proc terminalWidth*(): int =
|
||||||
## Returns **some** reasonable terminal width from either standard file
|
## Returns some reasonable terminal width from either standard file
|
||||||
## descriptors, controlling terminal, environment variables or tradition.
|
## descriptors, controlling terminal, environment variables or tradition.
|
||||||
|
|
||||||
var L_ctermid{.importc, header: "<stdio.h>".}: cint
|
|
||||||
var w = terminalWidthIoctl([0, 1, 2]) #Try standard file descriptors
|
var w = terminalWidthIoctl([0, 1, 2]) #Try standard file descriptors
|
||||||
if w > 0: return w
|
if w > 0: return w
|
||||||
var cterm = newString(L_ctermid) #Try controlling tty
|
var cterm = newString(L_ctermid) #Try controlling tty
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue