Skip to content

Commit

Permalink
F
Browse files Browse the repository at this point in the history
  • Loading branch information
adambabik committed Jan 5, 2023
1 parent 6b33e55 commit 1e849e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/kernel/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type Session struct {
cmd *exec.Cmd
ptmx *os.File
isReady bool
ready chan struct{} // notifies when the process is ready; for shell after observing first prompt
ready chan struct{} // notifies when the process is ready; for shells upon observing the first prompt
outputMu sync.Mutex
output io.Writer
outputCopyFunc func() error
Expand Down
3 changes: 3 additions & 0 deletions internal/kernel/session_shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ func (s *ShellSession) copyOutput() error {
err = errors.WithStack(er)
break
}
// TODO: improve this fragment. It seems that it is possible that prompt
// is split between multiple reads. If that's correct, this code won't
// detect that.
if bytes.Contains(buf[0:nr], s.prompt) {
s.promptDetected()
}
Expand Down

0 comments on commit 1e849e7

Please sign in to comment.