Terminal control/Dimensions: Difference between revisions
Content added Content deleted
(Go solution) |
(→{{header|Go}}: add sub-repo version) |
||
Line 212: | Line 212: | ||
=={{header|Go}}== |
=={{header|Go}}== |
||
===Sub-repository=== |
|||
{{libheader|Go sub-repositories}} |
|||
<lang go>package main |
|||
import ( |
|||
"fmt" |
|||
"os" |
|||
"code.google.com/p/go.crypto/ssh/terminal" |
|||
) |
|||
func main() { |
|||
w, h, err := terminal.GetSize(int(os.Stdout.Fd())) |
|||
if err != nil { |
|||
fmt.Println(err) |
|||
return |
|||
} |
|||
fmt.Println(h, w) |
|||
}</lang> |
|||
===External command=== |
===External command=== |
||
<lang go>package main |
<lang go>package main |