From e6a1d5a8534170644ff2b7ab64ffb4b581afc6cd Mon Sep 17 00:00:00 2001 From: Caleb Foust Date: Wed, 19 Jun 2024 20:42:51 +0800 Subject: [PATCH] fix: broken restarting command --- pkg/sessions/events.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/sessions/events.go b/pkg/sessions/events.go index 3465cabb..12c764cc 100644 --- a/pkg/sessions/events.go +++ b/pkg/sessions/events.go @@ -2,6 +2,7 @@ package sessions import ( "context" + "io" "time" P "github.com/cfoust/cy/pkg/io/protocol" @@ -43,6 +44,11 @@ func (s *EventStream) Write(data []byte) (n int, err error) { func (s *EventStream) Read(p []byte) (n int, err error) { n, err = s.stream.Read(p) + + if n == 0 || err == io.EOF { + return n, nil + } + if err != nil { return n, err }