This commit is contained in:
akrike
2025-09-07 11:10:09 +08:00
parent ab7ef546ea
commit 593185a431
12 changed files with 408 additions and 70 deletions

View File

@@ -2,6 +2,7 @@ package logic
import (
"bytes"
"errors"
"os"
"os/exec"
"strings"
@@ -113,10 +114,12 @@ func (p *ProcessPty) readInit() {
}
}
func (p *ProcessPty) ReadCache(ws ConnectInstance) {
if p.cacheBytesBuf != nil {
ws.Write(p.cacheBytesBuf.Bytes())
func (p *ProcessPty) ReadCache(ws ConnectInstance) error {
if p.cacheBytesBuf == nil {
return errors.New("cache is null")
}
ws.Write(p.cacheBytesBuf.Bytes())
return nil
}
func (p *ProcessPty) bufHanle(b []byte) {