Skip to content

Commit 844fa89

Browse files
committed
fixed stop routine with syscall on windows
1 parent e3c243e commit 844fa89

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

input.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -165,16 +165,18 @@ var hexCodes = map[string]keys.Key{
165165
func getKeyPress() (keys.Key, error) {
166166
var buf [256]byte
167167

168-
fmt.Println("a")
169168
// Read
170169
numBytes, err := inputTTY.Read(buf[:])
171170
if err != nil {
172171
if errors.Is(err, os.ErrClosed) {
173172
return keys.Key{}, nil
174173
}
174+
175+
if err.Error() == "EOF" {
176+
return keys.Key{}, nil
177+
}
175178
return keys.Key{}, fmt.Errorf("could not read stdin: %w", err)
176179
}
177-
fmt.Println("b")
178180

179181
// Check if it's a sequence
180182
if k, ok := sequences[string(buf[:numBytes])]; ok {

0 commit comments

Comments
 (0)