MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / MakePtyBuffer

Function MakePtyBuffer

pkg/wshutil/wshcmdreader.go:36–50  ·  view source on GitHub ↗

closes messageCh when input is closed (or error)

(oscPrefix string, input io.Reader, messageCh chan baseds.RpcInputChType)

Source from the content-addressed store, hash-verified

34
35// closes messageCh when input is closed (or error)
36func MakePtyBuffer(oscPrefix string, input io.Reader, messageCh chan baseds.RpcInputChType) *PtyBuffer {
37 if len(oscPrefix) != WaveOSCPrefixLen {
38 panic(fmt.Sprintf("invalid OSC prefix length: %d", len(oscPrefix)))
39 }
40 b := &PtyBuffer{
41 CVar: sync.NewCond(&sync.Mutex{}),
42 DataBuf: &bytes.Buffer{},
43 OSCPrefix: oscPrefix,
44 EscMode: Mode_Normal,
45 InputReader: input,
46 MessageCh: messageCh,
47 }
48 go b.run()
49 return b
50}
51
52func (b *PtyBuffer) setErr(err error) {
53 b.CVar.L.Lock()

Callers

nothing calls this directly

Calls 1

runMethod · 0.95

Tested by

no test coverage detected