From dc01b79c87308febfa870dca1975e823cce97ccc Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Fri, 30 Dec 2022 15:43:36 -0800 Subject: [PATCH] fixes #580 tcell custom tty on Windows will not work Applications will need to supply a working TTY of course. --- tscreen_stub.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tscreen_stub.go b/tscreen_stub.go index 341175b..9e3cdaa 100644 --- a/tscreen_stub.go +++ b/tscreen_stub.go @@ -1,7 +1,7 @@ //go:build js || plan9 || windows // +build js plan9 windows -// Copyright 2021 The TCell Authors +// Copyright 2022 The TCell Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use file except in compliance with the License. @@ -22,5 +22,11 @@ package tcell // that we can obtain with the console API present on Windows. func (t *tScreen) initialize() error { - return ErrNoScreen + if t.tty == nil { + return ErrNoScreen + } + // If a tty was supplied (custom), it should work. + // Custom screen implementations will need to provide a TTY + // implementation that we can use. + return nil }