动态指令增加录屏

This commit is contained in:
dushixiang authored and dushixiang committed 2021-02-12 16:55:07 +08:00
1 parent d72ab4e21e
commit b4421b1b56
9 files changed
+61 -90

No files matched your search

+8 -1
View File
@@ -75,7 +75,14 @@ func (ret *NextTerminal) Write(p []byte) (int, error) {
}
func (ret *NextTerminal) Read() ([]byte, int, error) {
return ret.NextWriter.Read()
bytes, n, err := ret.NextWriter.Read()
if err != nil {
return nil, 0, err
}
if ret.Recorder != nil && n > 0 {
_ = ret.Recorder.WriteData(string(bytes))
}
return bytes, n, nil
}
func (ret *NextTerminal) Close() error {
+2 -2
View File
@@ -108,8 +108,8 @@ func CreateRecording(recordingPath string, h int, w int) (*Recorder, error) {
header := &Header{
Title: "",
Version: 2,
Height: h,
Width: w,
Height: 42,
Width: 150,
Env: Env{Shell: "/bin/bash", Term: "xterm-256color"},
Timestamp: int(time.Now().Unix()),
}