diff --git a/cwriter/util_wasm.go b/cwriter/util_wasm.go new file mode 100644 index 00000000..7efaa619 --- /dev/null +++ b/cwriter/util_wasm.go @@ -0,0 +1,6 @@ +//+build wasm js + +package cwriter + +// There is no ioctl on wasm, so we just use a dummy value. +const ioctlReadTermios = 0 diff --git a/cwriter/writer_posix.go b/cwriter/writer_posix.go index f54a5d06..764bd97b 100644 --- a/cwriter/writer_posix.go +++ b/cwriter/writer_posix.go @@ -1,4 +1,4 @@ -// +build !windows +// +build !windows,!wasm,!js package cwriter diff --git a/cwriter/writer_wasm.go b/cwriter/writer_wasm.go new file mode 100644 index 00000000..360841df --- /dev/null +++ b/cwriter/writer_wasm.go @@ -0,0 +1,15 @@ +// +build wasm js + +package cwriter + +// Don't overwrite clearLines() + +// GetSize do nothing +func GetSize(fd int) (width, height int, err error) { + return 0, 0, nil +} + +// IsTerminal do nothing +func IsTerminal(fd int) bool { + return true +}