diff --git a/.github/workflows/crosscompile.yml b/.github/workflows/crosscompile.yml
new file mode 100644
index 0000000..db3987d
--- /dev/null
+++ b/.github/workflows/crosscompile.yml
@@ -0,0 +1,17 @@
+name: Crosscompile
+
+on:
+  push:
+    branches:
+    - master
+
+jobs:
+  test:
+    name: Run ./test_crosscompile.sh
+    runs-on: ubuntu-latest
+
+    steps:
+    - name: Checkout repo
+      uses: actions/checkout@v2
+    - name: Run ./test_crosscompile.sh
+      run: ./test_crosscompile.sh
\ No newline at end of file
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 0000000..9bc97a0
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,46 @@
+name: Test
+
+on:
+  push:
+    branches:
+    - master
+  pull_request:
+    branches:
+    - master
+
+jobs:
+  test:
+    name: "Test go ${{ matrix.go_version }} on ${{ matrix.platform }}"
+    runs-on: ${{ matrix.platform }}
+
+    strategy:
+      matrix:
+        platform:
+          - ubuntu-latest
+          - macos-latest
+        go_version:
+          # Test the two currently supported releases (https://go.dev/doc/devel/release#policy)
+          - 1.17.x
+          - 1.18.x
+        include:
+          # Also sanity test a very old release on linux
+          - platform: ubuntu-latest
+            go_version: 1.6.x
+
+    steps:
+      # 1.6 doesn't seem to default GOPATH to anything, so we set it explicitly here
+    - name: Set GOPATH
+      run: echo "GOPATH=$HOME/go" >> $GITHUB_ENV
+
+    - name: Set up Go ${{ matrix.go_version }}
+      uses: actions/setup-go@v3
+      with:
+        go-version: ${{ matrix.go_version }}
+        check-latest: true
+    - name: Checkout repo
+      uses: actions/checkout@v2
+
+    - name: Build
+      run: go build -v
+    - name: Test
+      run: go test -v
\ No newline at end of file
diff --git a/debian/changelog b/debian/changelog
index c43567c..8ad8108 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+golang-github-creack-pty (1.1.18-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Mon, 28 Mar 2022 21:01:30 -0000
+
 golang-github-creack-pty (1.1.17-1) unstable; urgency=medium
 
   * Team upload.
diff --git a/ioctl.go b/ioctl.go
index 0676437..3cabedd 100644
--- a/ioctl.go
+++ b/ioctl.go
@@ -1,5 +1,5 @@
-//go:build !windows && !solaris
-//+build !windows,!solaris
+//go:build !windows && !solaris && !aix
+// +build !windows,!solaris,!aix
 
 package pty
 
diff --git a/ioctl_bsd.go b/ioctl_bsd.go
index ab53e2d..db3bf84 100644
--- a/ioctl_bsd.go
+++ b/ioctl_bsd.go
@@ -1,5 +1,5 @@
-//go:build (darwin || dragonfly || freebsd || netbsd || openbsd)
-//+build darwin dragonfly freebsd netbsd openbsd
+//go:build darwin || dragonfly || freebsd || netbsd || openbsd
+// +build darwin dragonfly freebsd netbsd openbsd
 
 package pty
 
diff --git a/ioctl_solaris.go b/ioctl_solaris.go
index 8b6cc0e..bff22da 100644
--- a/ioctl_solaris.go
+++ b/ioctl_solaris.go
@@ -1,5 +1,5 @@
 //go:build solaris
-//+build solaris
+// +build solaris
 
 package pty
 
diff --git a/ioctl_unsupported.go b/ioctl_unsupported.go
new file mode 100644
index 0000000..2449a27
--- /dev/null
+++ b/ioctl_unsupported.go
@@ -0,0 +1,13 @@
+//go:build aix
+// +build aix
+
+package pty
+
+const (
+	TIOCGWINSZ = 0
+	TIOCSWINSZ = 0
+)
+
+func ioctl(fd, cmd, ptr uintptr) error {
+	return ErrUnsupported
+}
diff --git a/pty_darwin.go b/pty_darwin.go
index cca0971..9bdd71d 100644
--- a/pty_darwin.go
+++ b/pty_darwin.go
@@ -1,5 +1,5 @@
 //go:build darwin
-//+build darwin
+// +build darwin
 
 package pty
 
diff --git a/pty_dragonfly.go b/pty_dragonfly.go
index 7a1fec3..aa916aa 100644
--- a/pty_dragonfly.go
+++ b/pty_dragonfly.go
@@ -1,5 +1,5 @@
 //go:build dragonfly
-//+build dragonfly
+// +build dragonfly
 
 package pty
 
diff --git a/pty_freebsd.go b/pty_freebsd.go
index a4cfd92..bcd3b6f 100644
--- a/pty_freebsd.go
+++ b/pty_freebsd.go
@@ -1,5 +1,5 @@
 //go:build freebsd
-//+build freebsd
+// +build freebsd
 
 package pty
 
diff --git a/pty_linux.go b/pty_linux.go
index 22ccbe1..a3b368f 100644
--- a/pty_linux.go
+++ b/pty_linux.go
@@ -1,5 +1,5 @@
 //go:build linux
-//+build linux
+// +build linux
 
 package pty
 
diff --git a/pty_netbsd.go b/pty_netbsd.go
index 98c089c..2b20d94 100644
--- a/pty_netbsd.go
+++ b/pty_netbsd.go
@@ -1,5 +1,5 @@
 //go:build netbsd
-//+build netbsd
+// +build netbsd
 
 package pty
 
diff --git a/pty_openbsd.go b/pty_openbsd.go
index d72b9d8..031367a 100644
--- a/pty_openbsd.go
+++ b/pty_openbsd.go
@@ -1,5 +1,5 @@
 //go:build openbsd
-//+build openbsd
+// +build openbsd
 
 package pty
 
diff --git a/pty_solaris.go b/pty_solaris.go
index 17e4746..37f933e 100644
--- a/pty_solaris.go
+++ b/pty_solaris.go
@@ -1,5 +1,5 @@
 //go:build solaris
-//+build solaris
+// +build solaris
 
 package pty
 
diff --git a/pty_unsupported.go b/pty_unsupported.go
index 765523a..c771020 100644
--- a/pty_unsupported.go
+++ b/pty_unsupported.go
@@ -1,5 +1,5 @@
 //go:build !linux && !darwin && !freebsd && !dragonfly && !netbsd && !openbsd && !solaris
-//+build !linux,!darwin,!freebsd,!dragonfly,!netbsd,!openbsd,!solaris
+// +build !linux,!darwin,!freebsd,!dragonfly,!netbsd,!openbsd,!solaris
 
 package pty
 
diff --git a/run.go b/run.go
index 160001f..4755366 100644
--- a/run.go
+++ b/run.go
@@ -1,6 +1,3 @@
-//go:build !windows
-//+build !windows
-
 package pty
 
 import (
@@ -18,21 +15,6 @@ func Start(cmd *exec.Cmd) (*os.File, error) {
 	return StartWithSize(cmd, nil)
 }
 
-// StartWithSize assigns a pseudo-terminal tty os.File to c.Stdin, c.Stdout,
-// and c.Stderr, calls c.Start, and returns the File of the tty's
-// corresponding pty.
-//
-// This will resize the pty to the specified size before starting the command.
-// Starts the process in a new session and sets the controlling terminal.
-func StartWithSize(cmd *exec.Cmd, ws *Winsize) (*os.File, error) {
-	if cmd.SysProcAttr == nil {
-		cmd.SysProcAttr = &syscall.SysProcAttr{}
-	}
-	cmd.SysProcAttr.Setsid = true
-	cmd.SysProcAttr.Setctty = true
-	return StartWithAttrs(cmd, ws, cmd.SysProcAttr)
-}
-
 // StartWithAttrs assigns a pseudo-terminal tty os.File to c.Stdin, c.Stdout,
 // and c.Stderr, calls c.Start, and returns the File of the tty's
 // corresponding pty.
diff --git a/start.go b/start.go
new file mode 100644
index 0000000..9b51635
--- /dev/null
+++ b/start.go
@@ -0,0 +1,25 @@
+//go:build !windows
+// +build !windows
+
+package pty
+
+import (
+	"os"
+	"os/exec"
+	"syscall"
+)
+
+// StartWithSize assigns a pseudo-terminal tty os.File to c.Stdin, c.Stdout,
+// and c.Stderr, calls c.Start, and returns the File of the tty's
+// corresponding pty.
+//
+// This will resize the pty to the specified size before starting the command.
+// Starts the process in a new session and sets the controlling terminal.
+func StartWithSize(cmd *exec.Cmd, ws *Winsize) (*os.File, error) {
+	if cmd.SysProcAttr == nil {
+		cmd.SysProcAttr = &syscall.SysProcAttr{}
+	}
+	cmd.SysProcAttr.Setsid = true
+	cmd.SysProcAttr.Setctty = true
+	return StartWithAttrs(cmd, ws, cmd.SysProcAttr)
+}
diff --git a/start_windows.go b/start_windows.go
new file mode 100644
index 0000000..7e9530b
--- /dev/null
+++ b/start_windows.go
@@ -0,0 +1,19 @@
+//go:build windows
+// +build windows
+
+package pty
+
+import (
+	"os"
+	"os/exec"
+)
+
+// StartWithSize assigns a pseudo-terminal tty os.File to c.Stdin, c.Stdout,
+// and c.Stderr, calls c.Start, and returns the File of the tty's
+// corresponding pty.
+//
+// This will resize the pty to the specified size before starting the command.
+// Starts the process in a new session and sets the controlling terminal.
+func StartWithSize(cmd *exec.Cmd, ws *Winsize) (*os.File, error) {
+	return nil, ErrUnsupported
+}
diff --git a/test_crosscompile.sh b/test_crosscompile.sh
index bbab6b2..47e8b10 100755
--- a/test_crosscompile.sh
+++ b/test_crosscompile.sh
@@ -4,30 +4,30 @@
 # Does not actually test the logic, just the compilation so we make sure we don't break code depending on the lib.
 
 echo2() {
-    echo $@ >&2
+  echo $@ >&2
 }
 
 trap end 0
 end() {
-    [ "$?" = 0 ] && echo2 "Pass." || (echo2 "Fail."; exit 1)
+  [ "$?" = 0 ] && echo2 "Pass." || (echo2 "Fail."; exit 1)
 }
 
 cross() {
-    os=$1
-    shift
-    echo2 "Build for $os."
-    for arch in $@; do
-      echo2 "  - $os/$arch"
-      GOOS=$os GOARCH=$arch go build
-    done
-    echo2
+  os=$1
+  shift
+  echo2 "Build for $os."
+  for arch in $@; do
+    echo2 "  - $os/$arch"
+    GOOS=$os GOARCH=$arch go build
+  done
+  echo2
 }
 
 set -e
 
 cross linux     amd64 386 arm arm64 ppc64 ppc64le s390x mips mipsle mips64 mips64le
 cross darwin    amd64 arm64
-cross freebsd   amd64 386 arm arm64 ppc64
+cross freebsd   amd64 386 arm arm64
 cross netbsd    amd64 386 arm arm64
 cross openbsd   amd64 386 arm arm64
 cross dragonfly amd64
@@ -41,8 +41,8 @@ cross windows amd64 386 arm
 
 # Some os/arch require a different compiler. Run in docker.
 if ! hash docker; then
-    # If docker is not present, stop here.
-    return
+  # If docker is not present, stop here.
+  return
 fi
 
 echo2 "Build for linux."
diff --git a/types.go b/types.go
index f4cdc2e..6b91d32 100644
--- a/types.go
+++ b/types.go
@@ -1,5 +1,5 @@
 //go:build ignore
-//+build ignore
+// +build ignore
 
 package pty
 
diff --git a/types_dragonfly.go b/types_dragonfly.go
index 7385166..695727d 100644
--- a/types_dragonfly.go
+++ b/types_dragonfly.go
@@ -1,5 +1,5 @@
 //go:build ignore
-//+build ignore
+// +build ignore
 
 package pty
 
diff --git a/types_freebsd.go b/types_freebsd.go
index 9dd4e30..616152b 100644
--- a/types_freebsd.go
+++ b/types_freebsd.go
@@ -1,5 +1,5 @@
 //go:build ignore
-//+build ignore
+// +build ignore
 
 package pty
 
diff --git a/types_netbsd.go b/types_netbsd.go
index 3e18359..d51876e 100644
--- a/types_netbsd.go
+++ b/types_netbsd.go
@@ -1,5 +1,5 @@
 //go:build ignore
-//+build ignore
+// +build ignore
 
 package pty
 
diff --git a/types_openbsd.go b/types_openbsd.go
index 0a5df1b..3f475a0 100644
--- a/types_openbsd.go
+++ b/types_openbsd.go
@@ -1,5 +1,5 @@
 //go:build ignore
-//+build ignore
+// +build ignore
 
 package pty
 
diff --git a/winsize.go b/winsize.go
index 9660a93..57323f4 100644
--- a/winsize.go
+++ b/winsize.go
@@ -20,5 +20,8 @@ func InheritSize(pty, tty *os.File) error {
 // in each line) in terminal t.
 func Getsize(t *os.File) (rows, cols int, err error) {
 	ws, err := GetsizeFull(t)
-	return int(ws.Rows), int(ws.Cols), err
+	if err != nil {
+		return 0, 0, err
+	}
+	return int(ws.Rows), int(ws.Cols), nil
 }
diff --git a/winsize_unix.go b/winsize_unix.go
index f358e90..5d99c3d 100644
--- a/winsize_unix.go
+++ b/winsize_unix.go
@@ -1,5 +1,5 @@
 //go:build !windows
-//+build !windows
+// +build !windows
 
 package pty
 
diff --git a/winsize_unsupported.go b/winsize_unsupported.go
index c4bff44..0d21099 100644
--- a/winsize_unsupported.go
+++ b/winsize_unsupported.go
@@ -1,5 +1,5 @@
 //go:build windows
-//+build windows
+// +build windows
 
 package pty
 
@@ -9,7 +9,7 @@ import (
 
 // Winsize is a dummy struct to enable compilation on unsupported platforms.
 type Winsize struct {
-	Rows, Cols, X, Y uint
+	Rows, Cols, X, Y uint16
 }
 
 // Setsize resizes t to s.
diff --git a/ztypes_386.go b/ztypes_386.go
index 794515b..d126f4a 100644
--- a/ztypes_386.go
+++ b/ztypes_386.go
@@ -1,5 +1,5 @@
 //go:build 386
-//+build 386
+// +build 386
 
 // Created by cgo -godefs - DO NOT EDIT
 // cgo -godefs types.go
diff --git a/ztypes_amd64.go b/ztypes_amd64.go
index dc6c525..6c4a767 100644
--- a/ztypes_amd64.go
+++ b/ztypes_amd64.go
@@ -1,5 +1,5 @@
 //go:build amd64
-//+build amd64
+// +build amd64
 
 // Created by cgo -godefs - DO NOT EDIT
 // cgo -godefs types.go
diff --git a/ztypes_arm.go b/ztypes_arm.go
index eac9b1e..de6fe16 100644
--- a/ztypes_arm.go
+++ b/ztypes_arm.go
@@ -1,5 +1,5 @@
 //go:build arm
-//+build arm
+// +build arm
 
 // Created by cgo -godefs - DO NOT EDIT
 // cgo -godefs types.go
diff --git a/ztypes_arm64.go b/ztypes_arm64.go
index ecb3ddc..c4f315c 100644
--- a/ztypes_arm64.go
+++ b/ztypes_arm64.go
@@ -1,5 +1,5 @@
 //go:build arm64
-//+build arm64
+// +build arm64
 
 // Created by cgo -godefs - DO NOT EDIT
 // cgo -godefs types.go
diff --git a/ztypes_dragonfly_amd64.go b/ztypes_dragonfly_amd64.go
index f4054cb..183c421 100644
--- a/ztypes_dragonfly_amd64.go
+++ b/ztypes_dragonfly_amd64.go
@@ -1,5 +1,5 @@
 //go:build amd64 && dragonfly
-//+build amd64,dragonfly
+// +build amd64,dragonfly
 
 // Created by cgo -godefs - DO NOT EDIT
 // cgo -godefs types_dragonfly.go
diff --git a/ztypes_freebsd_386.go b/ztypes_freebsd_386.go
index 95a20ab..d80dbf7 100644
--- a/ztypes_freebsd_386.go
+++ b/ztypes_freebsd_386.go
@@ -1,5 +1,5 @@
 //go:build 386 && freebsd
-//+build 386,freebsd
+// +build 386,freebsd
 
 // Created by cgo -godefs - DO NOT EDIT
 // cgo -godefs types_freebsd.go
diff --git a/ztypes_freebsd_amd64.go b/ztypes_freebsd_amd64.go
index e03a071..bfab4e4 100644
--- a/ztypes_freebsd_amd64.go
+++ b/ztypes_freebsd_amd64.go
@@ -1,5 +1,5 @@
 //go:build amd64 && freebsd
-//+build amd64,freebsd
+// +build amd64,freebsd
 
 // Created by cgo -godefs - DO NOT EDIT
 // cgo -godefs types_freebsd.go
diff --git a/ztypes_freebsd_arm.go b/ztypes_freebsd_arm.go
index 7665bd3..3a8aeae 100644
--- a/ztypes_freebsd_arm.go
+++ b/ztypes_freebsd_arm.go
@@ -1,5 +1,5 @@
 //go:build arm && freebsd
-//+build arm,freebsd
+// +build arm,freebsd
 
 // Created by cgo -godefs - DO NOT EDIT
 // cgo -godefs types_freebsd.go
diff --git a/ztypes_freebsd_arm64.go b/ztypes_freebsd_arm64.go
index 3f95bb8..a839249 100644
--- a/ztypes_freebsd_arm64.go
+++ b/ztypes_freebsd_arm64.go
@@ -1,5 +1,5 @@
 //go:build arm64 && freebsd
-//+build arm64,freebsd
+// +build arm64,freebsd
 
 // Code generated by cmd/cgo -godefs; DO NOT EDIT.
 // cgo -godefs types_freebsd.go
diff --git a/ztypes_mipsx.go b/ztypes_mipsx.go
index eddad16..2812779 100644
--- a/ztypes_mipsx.go
+++ b/ztypes_mipsx.go
@@ -1,6 +1,6 @@
 //go:build (mips || mipsle || mips64 || mips64le) && linux
-//+build linux
-//+build mips mipsle mips64 mips64le
+// +build mips mipsle mips64 mips64le
+// +build linux
 
 // Created by cgo -godefs - DO NOT EDIT
 // cgo -godefs types.go
diff --git a/ztypes_netbsd_32bit_int.go b/ztypes_netbsd_32bit_int.go
index 5b32e63..2ab7c45 100644
--- a/ztypes_netbsd_32bit_int.go
+++ b/ztypes_netbsd_32bit_int.go
@@ -1,6 +1,6 @@
 //go:build (386 || amd64 || arm || arm64) && netbsd
-//+build netbsd
-//+build 386 amd64 arm arm64
+// +build 386 amd64 arm arm64
+// +build netbsd
 
 package pty
 
diff --git a/ztypes_openbsd_32bit_int.go b/ztypes_openbsd_32bit_int.go
index c9aa316..1eb0948 100644
--- a/ztypes_openbsd_32bit_int.go
+++ b/ztypes_openbsd_32bit_int.go
@@ -1,6 +1,6 @@
 //go:build (386 || amd64 || arm || arm64 || mips64) && openbsd
-//+build openbsd
-//+build 386 amd64 arm arm64 mips64
+// +build 386 amd64 arm arm64 mips64
+// +build openbsd
 
 package pty
 
diff --git a/ztypes_ppc64.go b/ztypes_ppc64.go
index 6863443..bbb3da8 100644
--- a/ztypes_ppc64.go
+++ b/ztypes_ppc64.go
@@ -1,5 +1,5 @@
 //go:build ppc64
-//+build ppc64
+// +build ppc64
 
 // Created by cgo -godefs - DO NOT EDIT
 // cgo -godefs types.go
diff --git a/ztypes_ppc64le.go b/ztypes_ppc64le.go
index 6b5621b..8a4fac3 100644
--- a/ztypes_ppc64le.go
+++ b/ztypes_ppc64le.go
@@ -1,5 +1,5 @@
 //go:build ppc64le
-//+build ppc64le
+// +build ppc64le
 
 // Created by cgo -godefs - DO NOT EDIT
 // cgo -godefs types.go
diff --git a/ztypes_riscvx.go b/ztypes_riscvx.go
index 1233e75..dc5da90 100644
--- a/ztypes_riscvx.go
+++ b/ztypes_riscvx.go
@@ -1,5 +1,5 @@
 //go:build riscv || riscv64
-//+build riscv riscv64
+// +build riscv riscv64
 
 // Code generated by cmd/cgo -godefs; DO NOT EDIT.
 // cgo -godefs types.go
diff --git a/ztypes_s390x.go b/ztypes_s390x.go
index 02facea..3433be7 100644
--- a/ztypes_s390x.go
+++ b/ztypes_s390x.go
@@ -1,5 +1,5 @@
 //go:build s390x
-//+build s390x
+// +build s390x
 
 // Created by cgo -godefs - DO NOT EDIT
 // cgo -godefs types.go