commit 887196f33e6a26520cbbff9c7f6f6c4be3412e2f Author: KV2773 Date: Mon Sep 21 01:59:05 2026 -0500 AIX full support diff --git a/ts_nosyscall.go b/ts_nosyscall.go new file mode 100644 index 0000000..725c5be --- /dev/null +++ b/ts_nosyscall.go @@ -0,0 +1,31 @@ +// +build solaris aix + +// Copyright 2017 Oleku Konko All rights reserved. +// Use of this source code is governed by a MIT +// license that can be found in the LICENSE file. + +// This module is a Terminal API for the Go Programming Language. +// The protocols were written in pure Go and works on windows and unix systems +package ts + +import ( + "syscall" + "golang.org/x/sys/unix" +) + +const ( + TIOCGWINSZ = 21608 +) + +// Get Windows Size +func GetSize() (ws Size, err error) { + var wsz *unix.Winsize + wsz, err = unix.IoctlGetWinsize(syscall.Stdout, TIOCGWINSZ) + + if err != nil { + ws = Size{80, 25, 0, 0} + } else { + ws = Size{wsz.Row, wsz.Col, wsz.Xpixel, wsz.Ypixel} + } + return ws, err +} diff --git a/ts_other.go b/ts_other.go index 9f85219..8705a5f 100644 --- a/ts_other.go +++ b/ts_other.go @@ -1,4 +1,4 @@ -// +build !windows,!darwin,!freebsd,!netbsd,!openbsd,!linux,!solaris +// +build !windows,!darwin,!freebsd,!netbsd,!openbsd,!linux,!solaris,!aix // Copyright 2014 Oleku Konko All rights reserved. // Use of this source code is governed by a MIT diff --git a/ts_x.go b/ts_x.go index 3b983c9..f165cf1 100644 --- a/ts_x.go +++ b/ts_x.go @@ -1,4 +1,4 @@ -// +build !windows,!solaris +// +build !windows,!solaris,!aix // Copyright 2014 Oleku Konko All rights reserved. // Use of this source code is governed by a MIT