From b83bddd937a2dfcd7fc910a4f1564568350e35c3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 27 Feb 2026 01:25:01 +0000 Subject: [PATCH 1/9] Initial plan From 4db8c153cb4097119595fc228af28ea6643efe70 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 27 Feb 2026 01:33:50 +0000 Subject: [PATCH 2/9] feat: add hidden wsh debugterm command with hex/decode modes Co-authored-by: sawka <2722291+sawka@users.noreply.github.com> --- cmd/wsh/cmd/wshcmd-debugterm.go | 182 +++++++++++++++++++++++++++ cmd/wsh/cmd/wshcmd-debugterm_test.go | 35 ++++++ frontend/app/store/wshclientapi.ts | 5 + frontend/types/gotypes.d.ts | 12 ++ pkg/wshrpc/wshclient/wshclient.go | 6 + pkg/wshrpc/wshrpctypes.go | 11 ++ pkg/wshrpc/wshserver/wshserver.go | 30 +++++ 7 files changed, 281 insertions(+) create mode 100644 cmd/wsh/cmd/wshcmd-debugterm.go create mode 100644 cmd/wsh/cmd/wshcmd-debugterm_test.go diff --git a/cmd/wsh/cmd/wshcmd-debugterm.go b/cmd/wsh/cmd/wshcmd-debugterm.go new file mode 100644 index 0000000000..7077028dd6 --- /dev/null +++ b/cmd/wsh/cmd/wshcmd-debugterm.go @@ -0,0 +1,182 @@ +// Copyright 2026, Command Line Inc. +// SPDX-License-Identifier: Apache-2.0 + +package cmd + +import ( + "encoding/base64" + "encoding/hex" + "fmt" + "strconv" + "strings" + + "github.com/spf13/cobra" + "github.com/wavetermdev/waveterm/pkg/wshrpc" + "github.com/wavetermdev/waveterm/pkg/wshrpc/wshclient" +) + +const ( + DebugTermModeHex = "hex" + DebugTermModeDecode = "decode" +) + +var debugTermCmd = &cobra.Command{ + Use: "debugterm", + Short: "inspect recent terminal output bytes", + RunE: debugTermRun, + PreRunE: preRunSetupRpcClient, + DisableFlagsInUseLine: true, + Hidden: true, +} + +var ( + debugTermSize int64 + debugTermMode string +) + +func init() { + rootCmd.AddCommand(debugTermCmd) + debugTermCmd.Flags().Int64Var(&debugTermSize, "size", 1000, "number of terminal bytes to read") + debugTermCmd.Flags().StringVar(&debugTermMode, "mode", DebugTermModeHex, "output mode: hex or decode") +} + +func debugTermRun(cmd *cobra.Command, args []string) (rtnErr error) { + defer func() { + sendActivity("debugterm", rtnErr == nil) + }() + if debugTermSize <= 0 { + return fmt.Errorf("size must be greater than 0") + } + mode := strings.ToLower(debugTermMode) + if mode != DebugTermModeHex && mode != DebugTermModeDecode { + return fmt.Errorf("invalid mode %q (expected %q or %q)", debugTermMode, DebugTermModeHex, DebugTermModeDecode) + } + fullORef, err := resolveBlockArg() + if err != nil { + return err + } + rtn, err := wshclient.DebugTermCommand(RpcClient, wshrpc.CommandDebugTermData{ + BlockId: fullORef.OID, + Size: debugTermSize, + }, &wshrpc.RpcOpts{Timeout: 2000}) + if err != nil { + return fmt.Errorf("reading terminal output: %w", err) + } + termData, err := base64.StdEncoding.DecodeString(rtn.Data64) + if err != nil { + return fmt.Errorf("decoding terminal output: %w", err) + } + var output string + if mode == DebugTermModeDecode { + output = formatDebugTermDecode(termData) + } else { + output = formatDebugTermHex(termData) + } + WriteStdout("%s", output) + return nil +} + +func formatDebugTermHex(data []byte) string { + return hex.Dump(data) +} + +func formatDebugTermDecode(data []byte) string { + if len(data) == 0 { + return "" + } + lines := make([]string, 0) + for i := 0; i < len(data); { + b := data[i] + if b == 0x1b { + if i+1 >= len(data) { + lines = append(lines, "ESC") + i++ + continue + } + next := data[i+1] + switch next { + case '[': + seq, end := consumeDebugTermCSI(data, i) + lines = append(lines, "CSI "+strconv.QuoteToASCII(string(seq))) + i = end + case ']': + seq, end := consumeDebugTermOSC(data, i) + lines = append(lines, "OSC "+strconv.QuoteToASCII(string(seq))) + i = end + case 'P': + seq, end := consumeDebugTermST(data, i) + lines = append(lines, "DCS "+strconv.QuoteToASCII(string(seq))) + i = end + case '^': + seq, end := consumeDebugTermST(data, i) + lines = append(lines, "PM "+strconv.QuoteToASCII(string(seq))) + i = end + case '_': + seq, end := consumeDebugTermST(data, i) + lines = append(lines, "APC "+strconv.QuoteToASCII(string(seq))) + i = end + default: + seq := data[i : i+2] + lines = append(lines, "ESC "+strconv.QuoteToASCII(string(seq))) + i += 2 + } + continue + } + if b == 0x07 { + lines = append(lines, "BEL") + i++ + continue + } + if isDebugTermTextByte(b) { + start := i + for i < len(data) && isDebugTermTextByte(data[i]) { + i++ + } + lines = append(lines, "TXT "+strconv.QuoteToASCII(string(data[start:i]))) + continue + } + lines = append(lines, fmt.Sprintf("CTL 0x%02x", b)) + i++ + } + return strings.Join(lines, "\n") + "\n" +} + +func consumeDebugTermCSI(data []byte, start int) ([]byte, int) { + i := start + 2 + for i < len(data) { + if data[i] >= 0x40 && data[i] <= 0x7e { + return data[start : i+1], i + 1 + } + i++ + } + return data[start:], len(data) +} + +func consumeDebugTermOSC(data []byte, start int) ([]byte, int) { + i := start + 2 + for i < len(data) { + if data[i] == 0x07 { + return data[start : i+1], i + 1 + } + if data[i] == 0x1b && i+1 < len(data) && data[i+1] == '\\' { + return data[start : i+2], i + 2 + } + i++ + } + return data[start:], len(data) +} + +func consumeDebugTermST(data []byte, start int) ([]byte, int) { + i := start + 2 + for i < len(data) { + if data[i] == 0x1b && i+1 < len(data) && data[i+1] == '\\' { + return data[start : i+2], i + 2 + } + i++ + } + return data[start:], len(data) +} + +func isDebugTermTextByte(b byte) bool { + return b == '\n' || b == '\r' || b == '\t' || (b >= 0x20 && b <= 0x7e) +} diff --git a/cmd/wsh/cmd/wshcmd-debugterm_test.go b/cmd/wsh/cmd/wshcmd-debugterm_test.go new file mode 100644 index 0000000000..236792e5e4 --- /dev/null +++ b/cmd/wsh/cmd/wshcmd-debugterm_test.go @@ -0,0 +1,35 @@ +// Copyright 2026, Command Line Inc. +// SPDX-License-Identifier: Apache-2.0 + +package cmd + +import ( + "strings" + "testing" +) + +func TestFormatDebugTermHex(t *testing.T) { + output := formatDebugTermHex([]byte("abc")) + if !strings.Contains(output, "61 62 63") { + t.Fatalf("unexpected hex output: %q", output) + } +} + +func TestFormatDebugTermDecode(t *testing.T) { + data := []byte("abc\x1b[31mred\x1b[0m\x07\x1b]0;title\x07\x00") + output := formatDebugTermDecode(data) + expected := []string{ + `TXT "abc"`, + `CSI "\x1b[31m"`, + `TXT "red"`, + `CSI "\x1b[0m"`, + `BEL`, + `OSC "\x1b]0;title\a"`, + `CTL 0x00`, + } + for _, line := range expected { + if !strings.Contains(output, line) { + t.Fatalf("missing decode line %q in output %q", line, output) + } + } +} diff --git a/frontend/app/store/wshclientapi.ts b/frontend/app/store/wshclientapi.ts index 93276f1aa9..e246d761ef 100644 --- a/frontend/app/store/wshclientapi.ts +++ b/frontend/app/store/wshclientapi.ts @@ -147,6 +147,11 @@ class RpcApiType { return client.wshRpcCall("createsubblock", data, opts); } + // command "debugterm" [call] + DebugTermCommand(client: WshClient, data: CommandDebugTermData, opts?: RpcOpts): Promise { + return client.wshRpcCall("debugterm", data, opts); + } + // command "deleteappfile" [call] DeleteAppFileCommand(client: WshClient, data: CommandDeleteAppFileData, opts?: RpcOpts): Promise { return client.wshRpcCall("deleteappfile", data, opts); diff --git a/frontend/types/gotypes.d.ts b/frontend/types/gotypes.d.ts index 96f0ca2660..313f8dbdec 100644 --- a/frontend/types/gotypes.d.ts +++ b/frontend/types/gotypes.d.ts @@ -278,6 +278,18 @@ declare global { blockdef: BlockDef; }; + // wshrpc.CommandDebugTermData + type CommandDebugTermData = { + blockid: string; + size: number; + }; + + // wshrpc.CommandDebugTermRtnData + type CommandDebugTermRtnData = { + offset: number; + data64: string; + }; + // wshrpc.CommandDeleteAppFileData type CommandDeleteAppFileData = { appid: string; diff --git a/pkg/wshrpc/wshclient/wshclient.go b/pkg/wshrpc/wshclient/wshclient.go index 68ac9a160f..6ac4746d16 100644 --- a/pkg/wshrpc/wshclient/wshclient.go +++ b/pkg/wshrpc/wshclient/wshclient.go @@ -184,6 +184,12 @@ func CreateSubBlockCommand(w *wshutil.WshRpc, data wshrpc.CommandCreateSubBlockD return resp, err } +// command "debugterm", wshserver.DebugTermCommand +func DebugTermCommand(w *wshutil.WshRpc, data wshrpc.CommandDebugTermData, opts *wshrpc.RpcOpts) (*wshrpc.CommandDebugTermRtnData, error) { + resp, err := sendRpcRequestCallHelper[*wshrpc.CommandDebugTermRtnData](w, "debugterm", data, opts) + return resp, err +} + // command "deleteappfile", wshserver.DeleteAppFileCommand func DeleteAppFileCommand(w *wshutil.WshRpc, data wshrpc.CommandDeleteAppFileData, opts *wshrpc.RpcOpts) error { _, err := sendRpcRequestCallHelper[any](w, "deleteappfile", data, opts) diff --git a/pkg/wshrpc/wshrpctypes.go b/pkg/wshrpc/wshrpctypes.go index eefd7fabd7..c7fa0cb428 100644 --- a/pkg/wshrpc/wshrpctypes.go +++ b/pkg/wshrpc/wshrpctypes.go @@ -74,6 +74,7 @@ type WshRpcInterface interface { GetFullConfigCommand(ctx context.Context) (wconfig.FullConfigType, error) GetWaveAIModeConfigCommand(ctx context.Context) (wconfig.AIModeConfigUpdate, error) BlockInfoCommand(ctx context.Context, blockId string) (*BlockInfoData, error) + DebugTermCommand(ctx context.Context, data CommandDebugTermData) (*CommandDebugTermRtnData, error) BlocksListCommand(ctx context.Context, data BlocksListRequest) ([]BlocksListEntry, error) WaveInfoCommand(ctx context.Context) (*WaveInfoData, error) WshActivityCommand(ct context.Context, data map[string]int) error @@ -579,6 +580,16 @@ type CommandVarResponseData struct { Exists bool `json:"exists"` } +type CommandDebugTermData struct { + BlockId string `json:"blockid"` + Size int64 `json:"size"` +} + +type CommandDebugTermRtnData struct { + Offset int64 `json:"offset"` + Data64 string `json:"data64"` +} + type PathCommandData struct { PathType string `json:"pathtype"` Open bool `json:"open"` diff --git a/pkg/wshrpc/wshserver/wshserver.go b/pkg/wshrpc/wshserver/wshserver.go index ff6a0eae85..c10f7553b3 100644 --- a/pkg/wshrpc/wshserver/wshserver.go +++ b/pkg/wshrpc/wshserver/wshserver.go @@ -807,6 +807,36 @@ func (ws *WshServer) BlockInfoCommand(ctx context.Context, blockId string) (*wsh }, nil } +func (ws *WshServer) DebugTermCommand(ctx context.Context, data wshrpc.CommandDebugTermData) (*wshrpc.CommandDebugTermRtnData, error) { + if data.BlockId == "" { + return nil, fmt.Errorf("blockid is required") + } + if data.Size <= 0 { + return nil, fmt.Errorf("size must be greater than 0") + } + waveFile, err := filestore.WFS.Stat(ctx, data.BlockId, wavebase.BlockFile_Term) + if err == fs.ErrNotExist { + return &wshrpc.CommandDebugTermRtnData{}, nil + } + if err != nil { + return nil, fmt.Errorf("error statting term file: %w", err) + } + readSize := data.Size + dataLength := waveFile.DataLength() + if readSize > dataLength { + readSize = dataLength + } + readOffset := dataLength - readSize + readOffset, readData, err := filestore.WFS.ReadAt(ctx, data.BlockId, wavebase.BlockFile_Term, readOffset, readSize) + if err != nil { + return nil, fmt.Errorf("error reading term file: %w", err) + } + return &wshrpc.CommandDebugTermRtnData{ + Offset: readOffset, + Data64: base64.StdEncoding.EncodeToString(readData), + }, nil +} + func (ws *WshServer) WaveInfoCommand(ctx context.Context) (*wshrpc.WaveInfoData, error) { return &wshrpc.WaveInfoData{ Version: wavebase.WaveVersion, From da769a67e4864f9a3b9becc9e29c1ff18ccc7ff7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 27 Feb 2026 01:36:23 +0000 Subject: [PATCH 3/9] chore: finalize debugterm command implementation checks Co-authored-by: sawka <2722291+sawka@users.noreply.github.com> --- tsunami/demo/cpuchart/go.mod | 7 +------ tsunami/demo/cpuchart/go.sum | 12 ------------ tsunami/demo/githubaction/go.mod | 7 ------- tsunami/demo/githubaction/go.sum | 4 ---- tsunami/demo/modaltest/go.mod | 7 ------- tsunami/demo/modaltest/go.sum | 4 ---- tsunami/demo/pomodoro/go.mod | 7 ------- tsunami/demo/pomodoro/go.sum | 4 ---- tsunami/demo/recharts/go.mod | 7 ------- tsunami/demo/recharts/go.sum | 4 ---- tsunami/demo/tabletest/go.mod | 7 ------- tsunami/demo/tabletest/go.sum | 4 ---- tsunami/demo/todo/go.mod | 7 ------- tsunami/demo/todo/go.sum | 4 ---- tsunami/demo/tsunamiconfig/go.mod | 7 ------- tsunami/demo/tsunamiconfig/go.sum | 4 ---- 16 files changed, 1 insertion(+), 95 deletions(-) diff --git a/tsunami/demo/cpuchart/go.mod b/tsunami/demo/cpuchart/go.mod index a828a4479b..72d2f4ddcc 100644 --- a/tsunami/demo/cpuchart/go.mod +++ b/tsunami/demo/cpuchart/go.mod @@ -2,17 +2,12 @@ module tsunami/app/cpuchart go 1.25.6 -require ( - github.com/shirou/gopsutil/v4 v4.25.8 - github.com/wavetermdev/waveterm/tsunami v0.0.0 -) +require github.com/shirou/gopsutil/v4 v4.25.8 require ( github.com/ebitengine/purego v0.8.4 // indirect github.com/go-ole/go-ole v1.2.6 // indirect - github.com/google/uuid v1.6.0 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect - github.com/outrigdev/goid v0.3.0 // indirect github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect github.com/tklauser/go-sysconf v0.3.15 // indirect github.com/tklauser/numcpus v0.10.0 // indirect diff --git a/tsunami/demo/cpuchart/go.sum b/tsunami/demo/cpuchart/go.sum index 4d3c872cfc..965d0ed1e9 100644 --- a/tsunami/demo/cpuchart/go.sum +++ b/tsunami/demo/cpuchart/go.sum @@ -1,26 +1,16 @@ -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/ebitengine/purego v0.8.4 h1:CF7LEKg5FFOsASUj0+QwaXf8Ht6TlFxg09+S9wz0omw= github.com/ebitengine/purego v0.8.4/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= -github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= -github.com/outrigdev/goid v0.3.0 h1:t/otQD3EXc45cLtQVPUnNgEyRaTQA4cPeu3qVcrsIws= -github.com/outrigdev/goid v0.3.0/go.mod h1:hEH7f27ypN/GHWt/7gvkRoFYR0LZizfUBIAbak4neVE= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/shirou/gopsutil/v4 v4.25.8 h1:NnAsw9lN7587WHxjJA9ryDnqhJpFH6A+wagYWTOH970= github.com/shirou/gopsutil/v4 v4.25.8/go.mod h1:q9QdMmfAOVIw7a+eF86P7ISEU6ka+NLgkUxlopV4RwI= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= -github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/tklauser/go-sysconf v0.3.15 h1:VE89k0criAymJ/Os65CSn1IXaol+1wrsFHEB8Ol49K4= github.com/tklauser/go-sysconf v0.3.15/go.mod h1:Dmjwr6tYFIseJw7a3dRLJfsHAMXZ3nEnL/aZY+0IuI4= github.com/tklauser/numcpus v0.10.0 h1:18njr6LDBk1zuna922MgdjQuJFjrdppsZG60sHGfjso= @@ -32,5 +22,3 @@ golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/tsunami/demo/githubaction/go.mod b/tsunami/demo/githubaction/go.mod index e93f7a5b90..8af0676a3c 100644 --- a/tsunami/demo/githubaction/go.mod +++ b/tsunami/demo/githubaction/go.mod @@ -2,11 +2,4 @@ module tsunami/app/githubaction go 1.25.6 -require github.com/wavetermdev/waveterm/tsunami v0.0.0 - -require ( - github.com/google/uuid v1.6.0 // indirect - github.com/outrigdev/goid v0.3.0 // indirect -) - replace github.com/wavetermdev/waveterm/tsunami => /Users/mike/work/waveterm/tsunami diff --git a/tsunami/demo/githubaction/go.sum b/tsunami/demo/githubaction/go.sum index 4c44991dfc..e69de29bb2 100644 --- a/tsunami/demo/githubaction/go.sum +++ b/tsunami/demo/githubaction/go.sum @@ -1,4 +0,0 @@ -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/outrigdev/goid v0.3.0 h1:t/otQD3EXc45cLtQVPUnNgEyRaTQA4cPeu3qVcrsIws= -github.com/outrigdev/goid v0.3.0/go.mod h1:hEH7f27ypN/GHWt/7gvkRoFYR0LZizfUBIAbak4neVE= diff --git a/tsunami/demo/modaltest/go.mod b/tsunami/demo/modaltest/go.mod index 7a4ec22e75..cd56206d7d 100644 --- a/tsunami/demo/modaltest/go.mod +++ b/tsunami/demo/modaltest/go.mod @@ -2,11 +2,4 @@ module github.com/wavetermdev/waveterm/tsunami/demo/modaltest go 1.25.6 -require github.com/wavetermdev/waveterm/tsunami v0.0.0-00010101000000-000000000000 - -require ( - github.com/google/uuid v1.6.0 // indirect - github.com/outrigdev/goid v0.3.0 // indirect -) - replace github.com/wavetermdev/waveterm/tsunami => /Users/mike/work/waveterm/tsunami diff --git a/tsunami/demo/modaltest/go.sum b/tsunami/demo/modaltest/go.sum index 4c44991dfc..e69de29bb2 100644 --- a/tsunami/demo/modaltest/go.sum +++ b/tsunami/demo/modaltest/go.sum @@ -1,4 +0,0 @@ -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/outrigdev/goid v0.3.0 h1:t/otQD3EXc45cLtQVPUnNgEyRaTQA4cPeu3qVcrsIws= -github.com/outrigdev/goid v0.3.0/go.mod h1:hEH7f27ypN/GHWt/7gvkRoFYR0LZizfUBIAbak4neVE= diff --git a/tsunami/demo/pomodoro/go.mod b/tsunami/demo/pomodoro/go.mod index 777fdb392e..9c6becc31f 100644 --- a/tsunami/demo/pomodoro/go.mod +++ b/tsunami/demo/pomodoro/go.mod @@ -2,11 +2,4 @@ module tsunami/app/pomodoro go 1.25.6 -require github.com/wavetermdev/waveterm/tsunami v0.0.0 - -require ( - github.com/google/uuid v1.6.0 // indirect - github.com/outrigdev/goid v0.3.0 // indirect -) - replace github.com/wavetermdev/waveterm/tsunami => /Users/mike/work/waveterm/tsunami diff --git a/tsunami/demo/pomodoro/go.sum b/tsunami/demo/pomodoro/go.sum index 4c44991dfc..e69de29bb2 100644 --- a/tsunami/demo/pomodoro/go.sum +++ b/tsunami/demo/pomodoro/go.sum @@ -1,4 +0,0 @@ -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/outrigdev/goid v0.3.0 h1:t/otQD3EXc45cLtQVPUnNgEyRaTQA4cPeu3qVcrsIws= -github.com/outrigdev/goid v0.3.0/go.mod h1:hEH7f27ypN/GHWt/7gvkRoFYR0LZizfUBIAbak4neVE= diff --git a/tsunami/demo/recharts/go.mod b/tsunami/demo/recharts/go.mod index 1369113900..4067012a94 100644 --- a/tsunami/demo/recharts/go.mod +++ b/tsunami/demo/recharts/go.mod @@ -2,11 +2,4 @@ module tsunami/app/recharts go 1.25.6 -require github.com/wavetermdev/waveterm/tsunami v0.0.0 - -require ( - github.com/google/uuid v1.6.0 // indirect - github.com/outrigdev/goid v0.3.0 // indirect -) - replace github.com/wavetermdev/waveterm/tsunami => /Users/mike/work/waveterm/tsunami diff --git a/tsunami/demo/recharts/go.sum b/tsunami/demo/recharts/go.sum index 4c44991dfc..e69de29bb2 100644 --- a/tsunami/demo/recharts/go.sum +++ b/tsunami/demo/recharts/go.sum @@ -1,4 +0,0 @@ -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/outrigdev/goid v0.3.0 h1:t/otQD3EXc45cLtQVPUnNgEyRaTQA4cPeu3qVcrsIws= -github.com/outrigdev/goid v0.3.0/go.mod h1:hEH7f27ypN/GHWt/7gvkRoFYR0LZizfUBIAbak4neVE= diff --git a/tsunami/demo/tabletest/go.mod b/tsunami/demo/tabletest/go.mod index 77550fcfbd..fdb23ddd6e 100644 --- a/tsunami/demo/tabletest/go.mod +++ b/tsunami/demo/tabletest/go.mod @@ -2,11 +2,4 @@ module tsunami/app/tabletest go 1.25.6 -require github.com/wavetermdev/waveterm/tsunami v0.0.0 - -require ( - github.com/google/uuid v1.6.0 // indirect - github.com/outrigdev/goid v0.3.0 // indirect -) - replace github.com/wavetermdev/waveterm/tsunami => /Users/mike/work/waveterm/tsunami diff --git a/tsunami/demo/tabletest/go.sum b/tsunami/demo/tabletest/go.sum index 4c44991dfc..e69de29bb2 100644 --- a/tsunami/demo/tabletest/go.sum +++ b/tsunami/demo/tabletest/go.sum @@ -1,4 +0,0 @@ -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/outrigdev/goid v0.3.0 h1:t/otQD3EXc45cLtQVPUnNgEyRaTQA4cPeu3qVcrsIws= -github.com/outrigdev/goid v0.3.0/go.mod h1:hEH7f27ypN/GHWt/7gvkRoFYR0LZizfUBIAbak4neVE= diff --git a/tsunami/demo/todo/go.mod b/tsunami/demo/todo/go.mod index c70affff32..1c17fba3c5 100644 --- a/tsunami/demo/todo/go.mod +++ b/tsunami/demo/todo/go.mod @@ -2,11 +2,4 @@ module tsunami/app/todo go 1.25.6 -require github.com/wavetermdev/waveterm/tsunami v0.0.0 - -require ( - github.com/google/uuid v1.6.0 // indirect - github.com/outrigdev/goid v0.3.0 // indirect -) - replace github.com/wavetermdev/waveterm/tsunami => /Users/mike/work/waveterm/tsunami diff --git a/tsunami/demo/todo/go.sum b/tsunami/demo/todo/go.sum index 4c44991dfc..e69de29bb2 100644 --- a/tsunami/demo/todo/go.sum +++ b/tsunami/demo/todo/go.sum @@ -1,4 +0,0 @@ -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/outrigdev/goid v0.3.0 h1:t/otQD3EXc45cLtQVPUnNgEyRaTQA4cPeu3qVcrsIws= -github.com/outrigdev/goid v0.3.0/go.mod h1:hEH7f27ypN/GHWt/7gvkRoFYR0LZizfUBIAbak4neVE= diff --git a/tsunami/demo/tsunamiconfig/go.mod b/tsunami/demo/tsunamiconfig/go.mod index bc485e2ace..a3118a9ca7 100644 --- a/tsunami/demo/tsunamiconfig/go.mod +++ b/tsunami/demo/tsunamiconfig/go.mod @@ -2,11 +2,4 @@ module tsunami/app/tsunamiconfig go 1.25.6 -require github.com/wavetermdev/waveterm/tsunami v0.0.0 - -require ( - github.com/google/uuid v1.6.0 // indirect - github.com/outrigdev/goid v0.3.0 // indirect -) - replace github.com/wavetermdev/waveterm/tsunami => /Users/mike/work/waveterm/tsunami diff --git a/tsunami/demo/tsunamiconfig/go.sum b/tsunami/demo/tsunamiconfig/go.sum index 4c44991dfc..e69de29bb2 100644 --- a/tsunami/demo/tsunamiconfig/go.sum +++ b/tsunami/demo/tsunamiconfig/go.sum @@ -1,4 +0,0 @@ -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/outrigdev/goid v0.3.0 h1:t/otQD3EXc45cLtQVPUnNgEyRaTQA4cPeu3qVcrsIws= -github.com/outrigdev/goid v0.3.0/go.mod h1:hEH7f27ypN/GHWt/7gvkRoFYR0LZizfUBIAbak4neVE= From 1937d7d40cd7cd8ad4dc9890449c283ccf7caeb0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 27 Feb 2026 01:36:35 +0000 Subject: [PATCH 4/9] chore: revert unintended tsunami demo module file changes Co-authored-by: sawka <2722291+sawka@users.noreply.github.com> --- tsunami/demo/cpuchart/go.mod | 7 ++++++- tsunami/demo/cpuchart/go.sum | 12 ++++++++++++ tsunami/demo/githubaction/go.mod | 7 +++++++ tsunami/demo/githubaction/go.sum | 4 ++++ tsunami/demo/modaltest/go.mod | 7 +++++++ tsunami/demo/modaltest/go.sum | 4 ++++ tsunami/demo/pomodoro/go.mod | 7 +++++++ tsunami/demo/pomodoro/go.sum | 4 ++++ tsunami/demo/recharts/go.mod | 7 +++++++ tsunami/demo/recharts/go.sum | 4 ++++ tsunami/demo/tabletest/go.mod | 7 +++++++ tsunami/demo/tabletest/go.sum | 4 ++++ tsunami/demo/todo/go.mod | 7 +++++++ tsunami/demo/todo/go.sum | 4 ++++ tsunami/demo/tsunamiconfig/go.mod | 7 +++++++ tsunami/demo/tsunamiconfig/go.sum | 4 ++++ 16 files changed, 95 insertions(+), 1 deletion(-) diff --git a/tsunami/demo/cpuchart/go.mod b/tsunami/demo/cpuchart/go.mod index 72d2f4ddcc..a828a4479b 100644 --- a/tsunami/demo/cpuchart/go.mod +++ b/tsunami/demo/cpuchart/go.mod @@ -2,12 +2,17 @@ module tsunami/app/cpuchart go 1.25.6 -require github.com/shirou/gopsutil/v4 v4.25.8 +require ( + github.com/shirou/gopsutil/v4 v4.25.8 + github.com/wavetermdev/waveterm/tsunami v0.0.0 +) require ( github.com/ebitengine/purego v0.8.4 // indirect github.com/go-ole/go-ole v1.2.6 // indirect + github.com/google/uuid v1.6.0 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect + github.com/outrigdev/goid v0.3.0 // indirect github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect github.com/tklauser/go-sysconf v0.3.15 // indirect github.com/tklauser/numcpus v0.10.0 // indirect diff --git a/tsunami/demo/cpuchart/go.sum b/tsunami/demo/cpuchart/go.sum index 965d0ed1e9..4d3c872cfc 100644 --- a/tsunami/demo/cpuchart/go.sum +++ b/tsunami/demo/cpuchart/go.sum @@ -1,16 +1,26 @@ +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/ebitengine/purego v0.8.4 h1:CF7LEKg5FFOsASUj0+QwaXf8Ht6TlFxg09+S9wz0omw= github.com/ebitengine/purego v0.8.4/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= +github.com/outrigdev/goid v0.3.0 h1:t/otQD3EXc45cLtQVPUnNgEyRaTQA4cPeu3qVcrsIws= +github.com/outrigdev/goid v0.3.0/go.mod h1:hEH7f27ypN/GHWt/7gvkRoFYR0LZizfUBIAbak4neVE= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/shirou/gopsutil/v4 v4.25.8 h1:NnAsw9lN7587WHxjJA9ryDnqhJpFH6A+wagYWTOH970= github.com/shirou/gopsutil/v4 v4.25.8/go.mod h1:q9QdMmfAOVIw7a+eF86P7ISEU6ka+NLgkUxlopV4RwI= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/tklauser/go-sysconf v0.3.15 h1:VE89k0criAymJ/Os65CSn1IXaol+1wrsFHEB8Ol49K4= github.com/tklauser/go-sysconf v0.3.15/go.mod h1:Dmjwr6tYFIseJw7a3dRLJfsHAMXZ3nEnL/aZY+0IuI4= github.com/tklauser/numcpus v0.10.0 h1:18njr6LDBk1zuna922MgdjQuJFjrdppsZG60sHGfjso= @@ -22,3 +32,5 @@ golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/tsunami/demo/githubaction/go.mod b/tsunami/demo/githubaction/go.mod index 8af0676a3c..e93f7a5b90 100644 --- a/tsunami/demo/githubaction/go.mod +++ b/tsunami/demo/githubaction/go.mod @@ -2,4 +2,11 @@ module tsunami/app/githubaction go 1.25.6 +require github.com/wavetermdev/waveterm/tsunami v0.0.0 + +require ( + github.com/google/uuid v1.6.0 // indirect + github.com/outrigdev/goid v0.3.0 // indirect +) + replace github.com/wavetermdev/waveterm/tsunami => /Users/mike/work/waveterm/tsunami diff --git a/tsunami/demo/githubaction/go.sum b/tsunami/demo/githubaction/go.sum index e69de29bb2..4c44991dfc 100644 --- a/tsunami/demo/githubaction/go.sum +++ b/tsunami/demo/githubaction/go.sum @@ -0,0 +1,4 @@ +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/outrigdev/goid v0.3.0 h1:t/otQD3EXc45cLtQVPUnNgEyRaTQA4cPeu3qVcrsIws= +github.com/outrigdev/goid v0.3.0/go.mod h1:hEH7f27ypN/GHWt/7gvkRoFYR0LZizfUBIAbak4neVE= diff --git a/tsunami/demo/modaltest/go.mod b/tsunami/demo/modaltest/go.mod index cd56206d7d..7a4ec22e75 100644 --- a/tsunami/demo/modaltest/go.mod +++ b/tsunami/demo/modaltest/go.mod @@ -2,4 +2,11 @@ module github.com/wavetermdev/waveterm/tsunami/demo/modaltest go 1.25.6 +require github.com/wavetermdev/waveterm/tsunami v0.0.0-00010101000000-000000000000 + +require ( + github.com/google/uuid v1.6.0 // indirect + github.com/outrigdev/goid v0.3.0 // indirect +) + replace github.com/wavetermdev/waveterm/tsunami => /Users/mike/work/waveterm/tsunami diff --git a/tsunami/demo/modaltest/go.sum b/tsunami/demo/modaltest/go.sum index e69de29bb2..4c44991dfc 100644 --- a/tsunami/demo/modaltest/go.sum +++ b/tsunami/demo/modaltest/go.sum @@ -0,0 +1,4 @@ +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/outrigdev/goid v0.3.0 h1:t/otQD3EXc45cLtQVPUnNgEyRaTQA4cPeu3qVcrsIws= +github.com/outrigdev/goid v0.3.0/go.mod h1:hEH7f27ypN/GHWt/7gvkRoFYR0LZizfUBIAbak4neVE= diff --git a/tsunami/demo/pomodoro/go.mod b/tsunami/demo/pomodoro/go.mod index 9c6becc31f..777fdb392e 100644 --- a/tsunami/demo/pomodoro/go.mod +++ b/tsunami/demo/pomodoro/go.mod @@ -2,4 +2,11 @@ module tsunami/app/pomodoro go 1.25.6 +require github.com/wavetermdev/waveterm/tsunami v0.0.0 + +require ( + github.com/google/uuid v1.6.0 // indirect + github.com/outrigdev/goid v0.3.0 // indirect +) + replace github.com/wavetermdev/waveterm/tsunami => /Users/mike/work/waveterm/tsunami diff --git a/tsunami/demo/pomodoro/go.sum b/tsunami/demo/pomodoro/go.sum index e69de29bb2..4c44991dfc 100644 --- a/tsunami/demo/pomodoro/go.sum +++ b/tsunami/demo/pomodoro/go.sum @@ -0,0 +1,4 @@ +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/outrigdev/goid v0.3.0 h1:t/otQD3EXc45cLtQVPUnNgEyRaTQA4cPeu3qVcrsIws= +github.com/outrigdev/goid v0.3.0/go.mod h1:hEH7f27ypN/GHWt/7gvkRoFYR0LZizfUBIAbak4neVE= diff --git a/tsunami/demo/recharts/go.mod b/tsunami/demo/recharts/go.mod index 4067012a94..1369113900 100644 --- a/tsunami/demo/recharts/go.mod +++ b/tsunami/demo/recharts/go.mod @@ -2,4 +2,11 @@ module tsunami/app/recharts go 1.25.6 +require github.com/wavetermdev/waveterm/tsunami v0.0.0 + +require ( + github.com/google/uuid v1.6.0 // indirect + github.com/outrigdev/goid v0.3.0 // indirect +) + replace github.com/wavetermdev/waveterm/tsunami => /Users/mike/work/waveterm/tsunami diff --git a/tsunami/demo/recharts/go.sum b/tsunami/demo/recharts/go.sum index e69de29bb2..4c44991dfc 100644 --- a/tsunami/demo/recharts/go.sum +++ b/tsunami/demo/recharts/go.sum @@ -0,0 +1,4 @@ +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/outrigdev/goid v0.3.0 h1:t/otQD3EXc45cLtQVPUnNgEyRaTQA4cPeu3qVcrsIws= +github.com/outrigdev/goid v0.3.0/go.mod h1:hEH7f27ypN/GHWt/7gvkRoFYR0LZizfUBIAbak4neVE= diff --git a/tsunami/demo/tabletest/go.mod b/tsunami/demo/tabletest/go.mod index fdb23ddd6e..77550fcfbd 100644 --- a/tsunami/demo/tabletest/go.mod +++ b/tsunami/demo/tabletest/go.mod @@ -2,4 +2,11 @@ module tsunami/app/tabletest go 1.25.6 +require github.com/wavetermdev/waveterm/tsunami v0.0.0 + +require ( + github.com/google/uuid v1.6.0 // indirect + github.com/outrigdev/goid v0.3.0 // indirect +) + replace github.com/wavetermdev/waveterm/tsunami => /Users/mike/work/waveterm/tsunami diff --git a/tsunami/demo/tabletest/go.sum b/tsunami/demo/tabletest/go.sum index e69de29bb2..4c44991dfc 100644 --- a/tsunami/demo/tabletest/go.sum +++ b/tsunami/demo/tabletest/go.sum @@ -0,0 +1,4 @@ +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/outrigdev/goid v0.3.0 h1:t/otQD3EXc45cLtQVPUnNgEyRaTQA4cPeu3qVcrsIws= +github.com/outrigdev/goid v0.3.0/go.mod h1:hEH7f27ypN/GHWt/7gvkRoFYR0LZizfUBIAbak4neVE= diff --git a/tsunami/demo/todo/go.mod b/tsunami/demo/todo/go.mod index 1c17fba3c5..c70affff32 100644 --- a/tsunami/demo/todo/go.mod +++ b/tsunami/demo/todo/go.mod @@ -2,4 +2,11 @@ module tsunami/app/todo go 1.25.6 +require github.com/wavetermdev/waveterm/tsunami v0.0.0 + +require ( + github.com/google/uuid v1.6.0 // indirect + github.com/outrigdev/goid v0.3.0 // indirect +) + replace github.com/wavetermdev/waveterm/tsunami => /Users/mike/work/waveterm/tsunami diff --git a/tsunami/demo/todo/go.sum b/tsunami/demo/todo/go.sum index e69de29bb2..4c44991dfc 100644 --- a/tsunami/demo/todo/go.sum +++ b/tsunami/demo/todo/go.sum @@ -0,0 +1,4 @@ +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/outrigdev/goid v0.3.0 h1:t/otQD3EXc45cLtQVPUnNgEyRaTQA4cPeu3qVcrsIws= +github.com/outrigdev/goid v0.3.0/go.mod h1:hEH7f27ypN/GHWt/7gvkRoFYR0LZizfUBIAbak4neVE= diff --git a/tsunami/demo/tsunamiconfig/go.mod b/tsunami/demo/tsunamiconfig/go.mod index a3118a9ca7..bc485e2ace 100644 --- a/tsunami/demo/tsunamiconfig/go.mod +++ b/tsunami/demo/tsunamiconfig/go.mod @@ -2,4 +2,11 @@ module tsunami/app/tsunamiconfig go 1.25.6 +require github.com/wavetermdev/waveterm/tsunami v0.0.0 + +require ( + github.com/google/uuid v1.6.0 // indirect + github.com/outrigdev/goid v0.3.0 // indirect +) + replace github.com/wavetermdev/waveterm/tsunami => /Users/mike/work/waveterm/tsunami diff --git a/tsunami/demo/tsunamiconfig/go.sum b/tsunami/demo/tsunamiconfig/go.sum index e69de29bb2..4c44991dfc 100644 --- a/tsunami/demo/tsunamiconfig/go.sum +++ b/tsunami/demo/tsunamiconfig/go.sum @@ -0,0 +1,4 @@ +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/outrigdev/goid v0.3.0 h1:t/otQD3EXc45cLtQVPUnNgEyRaTQA4cPeu3qVcrsIws= +github.com/outrigdev/goid v0.3.0/go.mod h1:hEH7f27ypN/GHWt/7gvkRoFYR0LZizfUBIAbak4neVE= From e110580b648fe5f558bc1e7250240a1dd20a3044 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 27 Feb 2026 02:48:51 +0000 Subject: [PATCH 5/9] feat: add stdin json array decode mode to debugterm Co-authored-by: sawka <2722291+sawka@users.noreply.github.com> --- cmd/wsh/cmd/wshcmd-debugterm.go | 37 ++++++++++++++++++++++++---- cmd/wsh/cmd/wshcmd-debugterm_test.go | 26 +++++++++++++++++++ 2 files changed, 58 insertions(+), 5 deletions(-) diff --git a/cmd/wsh/cmd/wshcmd-debugterm.go b/cmd/wsh/cmd/wshcmd-debugterm.go index 7077028dd6..1d78c672bd 100644 --- a/cmd/wsh/cmd/wshcmd-debugterm.go +++ b/cmd/wsh/cmd/wshcmd-debugterm.go @@ -6,7 +6,9 @@ package cmd import ( "encoding/base64" "encoding/hex" + "encoding/json" "fmt" + "io" "strconv" "strings" @@ -18,13 +20,13 @@ import ( const ( DebugTermModeHex = "hex" DebugTermModeDecode = "decode" + DebugTermModeStdin = "stdin" ) var debugTermCmd = &cobra.Command{ Use: "debugterm", Short: "inspect recent terminal output bytes", RunE: debugTermRun, - PreRunE: preRunSetupRpcClient, DisableFlagsInUseLine: true, Hidden: true, } @@ -37,19 +39,35 @@ var ( func init() { rootCmd.AddCommand(debugTermCmd) debugTermCmd.Flags().Int64Var(&debugTermSize, "size", 1000, "number of terminal bytes to read") - debugTermCmd.Flags().StringVar(&debugTermMode, "mode", DebugTermModeHex, "output mode: hex or decode") + debugTermCmd.Flags().StringVar(&debugTermMode, "mode", DebugTermModeHex, "output mode: hex, decode, or stdin") } func debugTermRun(cmd *cobra.Command, args []string) (rtnErr error) { defer func() { sendActivity("debugterm", rtnErr == nil) }() + mode := strings.ToLower(debugTermMode) + if mode != DebugTermModeHex && mode != DebugTermModeDecode && mode != DebugTermModeStdin { + return fmt.Errorf("invalid mode %q (expected %q, %q, or %q)", debugTermMode, DebugTermModeHex, DebugTermModeDecode, DebugTermModeStdin) + } + if mode == DebugTermModeStdin { + stdinData, err := io.ReadAll(WrappedStdin) + if err != nil { + return fmt.Errorf("reading stdin: %w", err) + } + termData, err := parseDebugTermStdinData(stdinData) + if err != nil { + return err + } + WriteStdout("%s", formatDebugTermDecode(termData)) + return nil + } if debugTermSize <= 0 { return fmt.Errorf("size must be greater than 0") } - mode := strings.ToLower(debugTermMode) - if mode != DebugTermModeHex && mode != DebugTermModeDecode { - return fmt.Errorf("invalid mode %q (expected %q or %q)", debugTermMode, DebugTermModeHex, DebugTermModeDecode) + err := preRunSetupRpcClient(cmd, args) + if err != nil { + return err } fullORef, err := resolveBlockArg() if err != nil { @@ -76,6 +94,15 @@ func debugTermRun(cmd *cobra.Command, args []string) (rtnErr error) { return nil } +func parseDebugTermStdinData(data []byte) ([]byte, error) { + var arr []string + err := json.Unmarshal(data, &arr) + if err != nil { + return nil, fmt.Errorf("stdin mode expects a JSON array of strings: %w", err) + } + return []byte(strings.Join(arr, "")), nil +} + func formatDebugTermHex(data []byte) string { return hex.Dump(data) } diff --git a/cmd/wsh/cmd/wshcmd-debugterm_test.go b/cmd/wsh/cmd/wshcmd-debugterm_test.go index 236792e5e4..2af3d6b976 100644 --- a/cmd/wsh/cmd/wshcmd-debugterm_test.go +++ b/cmd/wsh/cmd/wshcmd-debugterm_test.go @@ -33,3 +33,29 @@ func TestFormatDebugTermDecode(t *testing.T) { } } } + +func TestParseDebugTermStdinData(t *testing.T) { + data, err := parseDebugTermStdinData([]byte(`["abc","\u001b[31mred","\u001b[0m"]`)) + if err != nil { + t.Fatalf("parseDebugTermStdinData() error: %v", err) + } + output := formatDebugTermDecode(data) + expected := []string{ + `TXT "abc"`, + `CSI "\x1b[31m"`, + `TXT "red"`, + `CSI "\x1b[0m"`, + } + for _, line := range expected { + if !strings.Contains(output, line) { + t.Fatalf("missing decode line %q in output %q", line, output) + } + } +} + +func TestParseDebugTermStdinDataInvalid(t *testing.T) { + _, err := parseDebugTermStdinData([]byte(`{"not":"array"}`)) + if err == nil { + t.Fatalf("expected error for invalid stdin json") + } +} From 4c52ac7af462d0ac9afd1e535e07f7ba79bb4ae3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 27 Feb 2026 02:52:04 +0000 Subject: [PATCH 6/9] refactor: add stdin decode mode pre-run handling for debugterm Co-authored-by: sawka <2722291+sawka@users.noreply.github.com> --- cmd/wsh/cmd/wshcmd-debugterm.go | 30 +++++++++++++++++++++++------- tsunami/demo/cpuchart/go.mod | 7 +------ tsunami/demo/cpuchart/go.sum | 12 ------------ tsunami/demo/githubaction/go.mod | 7 ------- tsunami/demo/githubaction/go.sum | 4 ---- tsunami/demo/modaltest/go.mod | 7 ------- tsunami/demo/modaltest/go.sum | 4 ---- tsunami/demo/pomodoro/go.mod | 7 ------- tsunami/demo/pomodoro/go.sum | 4 ---- tsunami/demo/recharts/go.mod | 7 ------- tsunami/demo/recharts/go.sum | 4 ---- tsunami/demo/tabletest/go.mod | 7 ------- tsunami/demo/tabletest/go.sum | 4 ---- tsunami/demo/todo/go.mod | 7 ------- tsunami/demo/todo/go.sum | 4 ---- tsunami/demo/tsunamiconfig/go.mod | 7 ------- tsunami/demo/tsunamiconfig/go.sum | 4 ---- 17 files changed, 24 insertions(+), 102 deletions(-) diff --git a/cmd/wsh/cmd/wshcmd-debugterm.go b/cmd/wsh/cmd/wshcmd-debugterm.go index 1d78c672bd..c314b342e5 100644 --- a/cmd/wsh/cmd/wshcmd-debugterm.go +++ b/cmd/wsh/cmd/wshcmd-debugterm.go @@ -27,6 +27,7 @@ var debugTermCmd = &cobra.Command{ Use: "debugterm", Short: "inspect recent terminal output bytes", RunE: debugTermRun, + PreRunE: debugTermPreRun, DisableFlagsInUseLine: true, Hidden: true, } @@ -46,9 +47,9 @@ func debugTermRun(cmd *cobra.Command, args []string) (rtnErr error) { defer func() { sendActivity("debugterm", rtnErr == nil) }() - mode := strings.ToLower(debugTermMode) - if mode != DebugTermModeHex && mode != DebugTermModeDecode && mode != DebugTermModeStdin { - return fmt.Errorf("invalid mode %q (expected %q, %q, or %q)", debugTermMode, DebugTermModeHex, DebugTermModeDecode, DebugTermModeStdin) + mode, err := getDebugTermMode() + if err != nil { + return err } if mode == DebugTermModeStdin { stdinData, err := io.ReadAll(WrappedStdin) @@ -65,10 +66,6 @@ func debugTermRun(cmd *cobra.Command, args []string) (rtnErr error) { if debugTermSize <= 0 { return fmt.Errorf("size must be greater than 0") } - err := preRunSetupRpcClient(cmd, args) - if err != nil { - return err - } fullORef, err := resolveBlockArg() if err != nil { return err @@ -94,6 +91,25 @@ func debugTermRun(cmd *cobra.Command, args []string) (rtnErr error) { return nil } +func debugTermPreRun(cmd *cobra.Command, args []string) error { + mode, err := getDebugTermMode() + if err != nil { + return err + } + if mode == DebugTermModeStdin { + return nil + } + return preRunSetupRpcClient(cmd, args) +} + +func getDebugTermMode() (string, error) { + mode := strings.ToLower(debugTermMode) + if mode != DebugTermModeHex && mode != DebugTermModeDecode && mode != DebugTermModeStdin { + return "", fmt.Errorf("invalid mode %q (expected %q, %q, or %q)", debugTermMode, DebugTermModeHex, DebugTermModeDecode, DebugTermModeStdin) + } + return mode, nil +} + func parseDebugTermStdinData(data []byte) ([]byte, error) { var arr []string err := json.Unmarshal(data, &arr) diff --git a/tsunami/demo/cpuchart/go.mod b/tsunami/demo/cpuchart/go.mod index a828a4479b..72d2f4ddcc 100644 --- a/tsunami/demo/cpuchart/go.mod +++ b/tsunami/demo/cpuchart/go.mod @@ -2,17 +2,12 @@ module tsunami/app/cpuchart go 1.25.6 -require ( - github.com/shirou/gopsutil/v4 v4.25.8 - github.com/wavetermdev/waveterm/tsunami v0.0.0 -) +require github.com/shirou/gopsutil/v4 v4.25.8 require ( github.com/ebitengine/purego v0.8.4 // indirect github.com/go-ole/go-ole v1.2.6 // indirect - github.com/google/uuid v1.6.0 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect - github.com/outrigdev/goid v0.3.0 // indirect github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect github.com/tklauser/go-sysconf v0.3.15 // indirect github.com/tklauser/numcpus v0.10.0 // indirect diff --git a/tsunami/demo/cpuchart/go.sum b/tsunami/demo/cpuchart/go.sum index 4d3c872cfc..965d0ed1e9 100644 --- a/tsunami/demo/cpuchart/go.sum +++ b/tsunami/demo/cpuchart/go.sum @@ -1,26 +1,16 @@ -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/ebitengine/purego v0.8.4 h1:CF7LEKg5FFOsASUj0+QwaXf8Ht6TlFxg09+S9wz0omw= github.com/ebitengine/purego v0.8.4/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= -github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= -github.com/outrigdev/goid v0.3.0 h1:t/otQD3EXc45cLtQVPUnNgEyRaTQA4cPeu3qVcrsIws= -github.com/outrigdev/goid v0.3.0/go.mod h1:hEH7f27ypN/GHWt/7gvkRoFYR0LZizfUBIAbak4neVE= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/shirou/gopsutil/v4 v4.25.8 h1:NnAsw9lN7587WHxjJA9ryDnqhJpFH6A+wagYWTOH970= github.com/shirou/gopsutil/v4 v4.25.8/go.mod h1:q9QdMmfAOVIw7a+eF86P7ISEU6ka+NLgkUxlopV4RwI= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= -github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/tklauser/go-sysconf v0.3.15 h1:VE89k0criAymJ/Os65CSn1IXaol+1wrsFHEB8Ol49K4= github.com/tklauser/go-sysconf v0.3.15/go.mod h1:Dmjwr6tYFIseJw7a3dRLJfsHAMXZ3nEnL/aZY+0IuI4= github.com/tklauser/numcpus v0.10.0 h1:18njr6LDBk1zuna922MgdjQuJFjrdppsZG60sHGfjso= @@ -32,5 +22,3 @@ golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/tsunami/demo/githubaction/go.mod b/tsunami/demo/githubaction/go.mod index e93f7a5b90..8af0676a3c 100644 --- a/tsunami/demo/githubaction/go.mod +++ b/tsunami/demo/githubaction/go.mod @@ -2,11 +2,4 @@ module tsunami/app/githubaction go 1.25.6 -require github.com/wavetermdev/waveterm/tsunami v0.0.0 - -require ( - github.com/google/uuid v1.6.0 // indirect - github.com/outrigdev/goid v0.3.0 // indirect -) - replace github.com/wavetermdev/waveterm/tsunami => /Users/mike/work/waveterm/tsunami diff --git a/tsunami/demo/githubaction/go.sum b/tsunami/demo/githubaction/go.sum index 4c44991dfc..e69de29bb2 100644 --- a/tsunami/demo/githubaction/go.sum +++ b/tsunami/demo/githubaction/go.sum @@ -1,4 +0,0 @@ -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/outrigdev/goid v0.3.0 h1:t/otQD3EXc45cLtQVPUnNgEyRaTQA4cPeu3qVcrsIws= -github.com/outrigdev/goid v0.3.0/go.mod h1:hEH7f27ypN/GHWt/7gvkRoFYR0LZizfUBIAbak4neVE= diff --git a/tsunami/demo/modaltest/go.mod b/tsunami/demo/modaltest/go.mod index 7a4ec22e75..cd56206d7d 100644 --- a/tsunami/demo/modaltest/go.mod +++ b/tsunami/demo/modaltest/go.mod @@ -2,11 +2,4 @@ module github.com/wavetermdev/waveterm/tsunami/demo/modaltest go 1.25.6 -require github.com/wavetermdev/waveterm/tsunami v0.0.0-00010101000000-000000000000 - -require ( - github.com/google/uuid v1.6.0 // indirect - github.com/outrigdev/goid v0.3.0 // indirect -) - replace github.com/wavetermdev/waveterm/tsunami => /Users/mike/work/waveterm/tsunami diff --git a/tsunami/demo/modaltest/go.sum b/tsunami/demo/modaltest/go.sum index 4c44991dfc..e69de29bb2 100644 --- a/tsunami/demo/modaltest/go.sum +++ b/tsunami/demo/modaltest/go.sum @@ -1,4 +0,0 @@ -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/outrigdev/goid v0.3.0 h1:t/otQD3EXc45cLtQVPUnNgEyRaTQA4cPeu3qVcrsIws= -github.com/outrigdev/goid v0.3.0/go.mod h1:hEH7f27ypN/GHWt/7gvkRoFYR0LZizfUBIAbak4neVE= diff --git a/tsunami/demo/pomodoro/go.mod b/tsunami/demo/pomodoro/go.mod index 777fdb392e..9c6becc31f 100644 --- a/tsunami/demo/pomodoro/go.mod +++ b/tsunami/demo/pomodoro/go.mod @@ -2,11 +2,4 @@ module tsunami/app/pomodoro go 1.25.6 -require github.com/wavetermdev/waveterm/tsunami v0.0.0 - -require ( - github.com/google/uuid v1.6.0 // indirect - github.com/outrigdev/goid v0.3.0 // indirect -) - replace github.com/wavetermdev/waveterm/tsunami => /Users/mike/work/waveterm/tsunami diff --git a/tsunami/demo/pomodoro/go.sum b/tsunami/demo/pomodoro/go.sum index 4c44991dfc..e69de29bb2 100644 --- a/tsunami/demo/pomodoro/go.sum +++ b/tsunami/demo/pomodoro/go.sum @@ -1,4 +0,0 @@ -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/outrigdev/goid v0.3.0 h1:t/otQD3EXc45cLtQVPUnNgEyRaTQA4cPeu3qVcrsIws= -github.com/outrigdev/goid v0.3.0/go.mod h1:hEH7f27ypN/GHWt/7gvkRoFYR0LZizfUBIAbak4neVE= diff --git a/tsunami/demo/recharts/go.mod b/tsunami/demo/recharts/go.mod index 1369113900..4067012a94 100644 --- a/tsunami/demo/recharts/go.mod +++ b/tsunami/demo/recharts/go.mod @@ -2,11 +2,4 @@ module tsunami/app/recharts go 1.25.6 -require github.com/wavetermdev/waveterm/tsunami v0.0.0 - -require ( - github.com/google/uuid v1.6.0 // indirect - github.com/outrigdev/goid v0.3.0 // indirect -) - replace github.com/wavetermdev/waveterm/tsunami => /Users/mike/work/waveterm/tsunami diff --git a/tsunami/demo/recharts/go.sum b/tsunami/demo/recharts/go.sum index 4c44991dfc..e69de29bb2 100644 --- a/tsunami/demo/recharts/go.sum +++ b/tsunami/demo/recharts/go.sum @@ -1,4 +0,0 @@ -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/outrigdev/goid v0.3.0 h1:t/otQD3EXc45cLtQVPUnNgEyRaTQA4cPeu3qVcrsIws= -github.com/outrigdev/goid v0.3.0/go.mod h1:hEH7f27ypN/GHWt/7gvkRoFYR0LZizfUBIAbak4neVE= diff --git a/tsunami/demo/tabletest/go.mod b/tsunami/demo/tabletest/go.mod index 77550fcfbd..fdb23ddd6e 100644 --- a/tsunami/demo/tabletest/go.mod +++ b/tsunami/demo/tabletest/go.mod @@ -2,11 +2,4 @@ module tsunami/app/tabletest go 1.25.6 -require github.com/wavetermdev/waveterm/tsunami v0.0.0 - -require ( - github.com/google/uuid v1.6.0 // indirect - github.com/outrigdev/goid v0.3.0 // indirect -) - replace github.com/wavetermdev/waveterm/tsunami => /Users/mike/work/waveterm/tsunami diff --git a/tsunami/demo/tabletest/go.sum b/tsunami/demo/tabletest/go.sum index 4c44991dfc..e69de29bb2 100644 --- a/tsunami/demo/tabletest/go.sum +++ b/tsunami/demo/tabletest/go.sum @@ -1,4 +0,0 @@ -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/outrigdev/goid v0.3.0 h1:t/otQD3EXc45cLtQVPUnNgEyRaTQA4cPeu3qVcrsIws= -github.com/outrigdev/goid v0.3.0/go.mod h1:hEH7f27ypN/GHWt/7gvkRoFYR0LZizfUBIAbak4neVE= diff --git a/tsunami/demo/todo/go.mod b/tsunami/demo/todo/go.mod index c70affff32..1c17fba3c5 100644 --- a/tsunami/demo/todo/go.mod +++ b/tsunami/demo/todo/go.mod @@ -2,11 +2,4 @@ module tsunami/app/todo go 1.25.6 -require github.com/wavetermdev/waveterm/tsunami v0.0.0 - -require ( - github.com/google/uuid v1.6.0 // indirect - github.com/outrigdev/goid v0.3.0 // indirect -) - replace github.com/wavetermdev/waveterm/tsunami => /Users/mike/work/waveterm/tsunami diff --git a/tsunami/demo/todo/go.sum b/tsunami/demo/todo/go.sum index 4c44991dfc..e69de29bb2 100644 --- a/tsunami/demo/todo/go.sum +++ b/tsunami/demo/todo/go.sum @@ -1,4 +0,0 @@ -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/outrigdev/goid v0.3.0 h1:t/otQD3EXc45cLtQVPUnNgEyRaTQA4cPeu3qVcrsIws= -github.com/outrigdev/goid v0.3.0/go.mod h1:hEH7f27ypN/GHWt/7gvkRoFYR0LZizfUBIAbak4neVE= diff --git a/tsunami/demo/tsunamiconfig/go.mod b/tsunami/demo/tsunamiconfig/go.mod index bc485e2ace..a3118a9ca7 100644 --- a/tsunami/demo/tsunamiconfig/go.mod +++ b/tsunami/demo/tsunamiconfig/go.mod @@ -2,11 +2,4 @@ module tsunami/app/tsunamiconfig go 1.25.6 -require github.com/wavetermdev/waveterm/tsunami v0.0.0 - -require ( - github.com/google/uuid v1.6.0 // indirect - github.com/outrigdev/goid v0.3.0 // indirect -) - replace github.com/wavetermdev/waveterm/tsunami => /Users/mike/work/waveterm/tsunami diff --git a/tsunami/demo/tsunamiconfig/go.sum b/tsunami/demo/tsunamiconfig/go.sum index 4c44991dfc..e69de29bb2 100644 --- a/tsunami/demo/tsunamiconfig/go.sum +++ b/tsunami/demo/tsunamiconfig/go.sum @@ -1,4 +0,0 @@ -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/outrigdev/goid v0.3.0 h1:t/otQD3EXc45cLtQVPUnNgEyRaTQA4cPeu3qVcrsIws= -github.com/outrigdev/goid v0.3.0/go.mod h1:hEH7f27ypN/GHWt/7gvkRoFYR0LZizfUBIAbak4neVE= From 8dc9257a92cdf0436fe0411f840d9c7625125b24 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 27 Feb 2026 02:52:17 +0000 Subject: [PATCH 7/9] chore: revert unintended tsunami demo module file changes Co-authored-by: sawka <2722291+sawka@users.noreply.github.com> --- tsunami/demo/cpuchart/go.mod | 7 ++++++- tsunami/demo/cpuchart/go.sum | 12 ++++++++++++ tsunami/demo/githubaction/go.mod | 7 +++++++ tsunami/demo/githubaction/go.sum | 4 ++++ tsunami/demo/modaltest/go.mod | 7 +++++++ tsunami/demo/modaltest/go.sum | 4 ++++ tsunami/demo/pomodoro/go.mod | 7 +++++++ tsunami/demo/pomodoro/go.sum | 4 ++++ tsunami/demo/recharts/go.mod | 7 +++++++ tsunami/demo/recharts/go.sum | 4 ++++ tsunami/demo/tabletest/go.mod | 7 +++++++ tsunami/demo/tabletest/go.sum | 4 ++++ tsunami/demo/todo/go.mod | 7 +++++++ tsunami/demo/todo/go.sum | 4 ++++ tsunami/demo/tsunamiconfig/go.mod | 7 +++++++ tsunami/demo/tsunamiconfig/go.sum | 4 ++++ 16 files changed, 95 insertions(+), 1 deletion(-) diff --git a/tsunami/demo/cpuchart/go.mod b/tsunami/demo/cpuchart/go.mod index 72d2f4ddcc..a828a4479b 100644 --- a/tsunami/demo/cpuchart/go.mod +++ b/tsunami/demo/cpuchart/go.mod @@ -2,12 +2,17 @@ module tsunami/app/cpuchart go 1.25.6 -require github.com/shirou/gopsutil/v4 v4.25.8 +require ( + github.com/shirou/gopsutil/v4 v4.25.8 + github.com/wavetermdev/waveterm/tsunami v0.0.0 +) require ( github.com/ebitengine/purego v0.8.4 // indirect github.com/go-ole/go-ole v1.2.6 // indirect + github.com/google/uuid v1.6.0 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect + github.com/outrigdev/goid v0.3.0 // indirect github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect github.com/tklauser/go-sysconf v0.3.15 // indirect github.com/tklauser/numcpus v0.10.0 // indirect diff --git a/tsunami/demo/cpuchart/go.sum b/tsunami/demo/cpuchart/go.sum index 965d0ed1e9..4d3c872cfc 100644 --- a/tsunami/demo/cpuchart/go.sum +++ b/tsunami/demo/cpuchart/go.sum @@ -1,16 +1,26 @@ +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/ebitengine/purego v0.8.4 h1:CF7LEKg5FFOsASUj0+QwaXf8Ht6TlFxg09+S9wz0omw= github.com/ebitengine/purego v0.8.4/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4= github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= +github.com/outrigdev/goid v0.3.0 h1:t/otQD3EXc45cLtQVPUnNgEyRaTQA4cPeu3qVcrsIws= +github.com/outrigdev/goid v0.3.0/go.mod h1:hEH7f27ypN/GHWt/7gvkRoFYR0LZizfUBIAbak4neVE= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU= github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE= github.com/shirou/gopsutil/v4 v4.25.8 h1:NnAsw9lN7587WHxjJA9ryDnqhJpFH6A+wagYWTOH970= github.com/shirou/gopsutil/v4 v4.25.8/go.mod h1:q9QdMmfAOVIw7a+eF86P7ISEU6ka+NLgkUxlopV4RwI= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/tklauser/go-sysconf v0.3.15 h1:VE89k0criAymJ/Os65CSn1IXaol+1wrsFHEB8Ol49K4= github.com/tklauser/go-sysconf v0.3.15/go.mod h1:Dmjwr6tYFIseJw7a3dRLJfsHAMXZ3nEnL/aZY+0IuI4= github.com/tklauser/numcpus v0.10.0 h1:18njr6LDBk1zuna922MgdjQuJFjrdppsZG60sHGfjso= @@ -22,3 +32,5 @@ golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/tsunami/demo/githubaction/go.mod b/tsunami/demo/githubaction/go.mod index 8af0676a3c..e93f7a5b90 100644 --- a/tsunami/demo/githubaction/go.mod +++ b/tsunami/demo/githubaction/go.mod @@ -2,4 +2,11 @@ module tsunami/app/githubaction go 1.25.6 +require github.com/wavetermdev/waveterm/tsunami v0.0.0 + +require ( + github.com/google/uuid v1.6.0 // indirect + github.com/outrigdev/goid v0.3.0 // indirect +) + replace github.com/wavetermdev/waveterm/tsunami => /Users/mike/work/waveterm/tsunami diff --git a/tsunami/demo/githubaction/go.sum b/tsunami/demo/githubaction/go.sum index e69de29bb2..4c44991dfc 100644 --- a/tsunami/demo/githubaction/go.sum +++ b/tsunami/demo/githubaction/go.sum @@ -0,0 +1,4 @@ +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/outrigdev/goid v0.3.0 h1:t/otQD3EXc45cLtQVPUnNgEyRaTQA4cPeu3qVcrsIws= +github.com/outrigdev/goid v0.3.0/go.mod h1:hEH7f27ypN/GHWt/7gvkRoFYR0LZizfUBIAbak4neVE= diff --git a/tsunami/demo/modaltest/go.mod b/tsunami/demo/modaltest/go.mod index cd56206d7d..7a4ec22e75 100644 --- a/tsunami/demo/modaltest/go.mod +++ b/tsunami/demo/modaltest/go.mod @@ -2,4 +2,11 @@ module github.com/wavetermdev/waveterm/tsunami/demo/modaltest go 1.25.6 +require github.com/wavetermdev/waveterm/tsunami v0.0.0-00010101000000-000000000000 + +require ( + github.com/google/uuid v1.6.0 // indirect + github.com/outrigdev/goid v0.3.0 // indirect +) + replace github.com/wavetermdev/waveterm/tsunami => /Users/mike/work/waveterm/tsunami diff --git a/tsunami/demo/modaltest/go.sum b/tsunami/demo/modaltest/go.sum index e69de29bb2..4c44991dfc 100644 --- a/tsunami/demo/modaltest/go.sum +++ b/tsunami/demo/modaltest/go.sum @@ -0,0 +1,4 @@ +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/outrigdev/goid v0.3.0 h1:t/otQD3EXc45cLtQVPUnNgEyRaTQA4cPeu3qVcrsIws= +github.com/outrigdev/goid v0.3.0/go.mod h1:hEH7f27ypN/GHWt/7gvkRoFYR0LZizfUBIAbak4neVE= diff --git a/tsunami/demo/pomodoro/go.mod b/tsunami/demo/pomodoro/go.mod index 9c6becc31f..777fdb392e 100644 --- a/tsunami/demo/pomodoro/go.mod +++ b/tsunami/demo/pomodoro/go.mod @@ -2,4 +2,11 @@ module tsunami/app/pomodoro go 1.25.6 +require github.com/wavetermdev/waveterm/tsunami v0.0.0 + +require ( + github.com/google/uuid v1.6.0 // indirect + github.com/outrigdev/goid v0.3.0 // indirect +) + replace github.com/wavetermdev/waveterm/tsunami => /Users/mike/work/waveterm/tsunami diff --git a/tsunami/demo/pomodoro/go.sum b/tsunami/demo/pomodoro/go.sum index e69de29bb2..4c44991dfc 100644 --- a/tsunami/demo/pomodoro/go.sum +++ b/tsunami/demo/pomodoro/go.sum @@ -0,0 +1,4 @@ +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/outrigdev/goid v0.3.0 h1:t/otQD3EXc45cLtQVPUnNgEyRaTQA4cPeu3qVcrsIws= +github.com/outrigdev/goid v0.3.0/go.mod h1:hEH7f27ypN/GHWt/7gvkRoFYR0LZizfUBIAbak4neVE= diff --git a/tsunami/demo/recharts/go.mod b/tsunami/demo/recharts/go.mod index 4067012a94..1369113900 100644 --- a/tsunami/demo/recharts/go.mod +++ b/tsunami/demo/recharts/go.mod @@ -2,4 +2,11 @@ module tsunami/app/recharts go 1.25.6 +require github.com/wavetermdev/waveterm/tsunami v0.0.0 + +require ( + github.com/google/uuid v1.6.0 // indirect + github.com/outrigdev/goid v0.3.0 // indirect +) + replace github.com/wavetermdev/waveterm/tsunami => /Users/mike/work/waveterm/tsunami diff --git a/tsunami/demo/recharts/go.sum b/tsunami/demo/recharts/go.sum index e69de29bb2..4c44991dfc 100644 --- a/tsunami/demo/recharts/go.sum +++ b/tsunami/demo/recharts/go.sum @@ -0,0 +1,4 @@ +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/outrigdev/goid v0.3.0 h1:t/otQD3EXc45cLtQVPUnNgEyRaTQA4cPeu3qVcrsIws= +github.com/outrigdev/goid v0.3.0/go.mod h1:hEH7f27ypN/GHWt/7gvkRoFYR0LZizfUBIAbak4neVE= diff --git a/tsunami/demo/tabletest/go.mod b/tsunami/demo/tabletest/go.mod index fdb23ddd6e..77550fcfbd 100644 --- a/tsunami/demo/tabletest/go.mod +++ b/tsunami/demo/tabletest/go.mod @@ -2,4 +2,11 @@ module tsunami/app/tabletest go 1.25.6 +require github.com/wavetermdev/waveterm/tsunami v0.0.0 + +require ( + github.com/google/uuid v1.6.0 // indirect + github.com/outrigdev/goid v0.3.0 // indirect +) + replace github.com/wavetermdev/waveterm/tsunami => /Users/mike/work/waveterm/tsunami diff --git a/tsunami/demo/tabletest/go.sum b/tsunami/demo/tabletest/go.sum index e69de29bb2..4c44991dfc 100644 --- a/tsunami/demo/tabletest/go.sum +++ b/tsunami/demo/tabletest/go.sum @@ -0,0 +1,4 @@ +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/outrigdev/goid v0.3.0 h1:t/otQD3EXc45cLtQVPUnNgEyRaTQA4cPeu3qVcrsIws= +github.com/outrigdev/goid v0.3.0/go.mod h1:hEH7f27ypN/GHWt/7gvkRoFYR0LZizfUBIAbak4neVE= diff --git a/tsunami/demo/todo/go.mod b/tsunami/demo/todo/go.mod index 1c17fba3c5..c70affff32 100644 --- a/tsunami/demo/todo/go.mod +++ b/tsunami/demo/todo/go.mod @@ -2,4 +2,11 @@ module tsunami/app/todo go 1.25.6 +require github.com/wavetermdev/waveterm/tsunami v0.0.0 + +require ( + github.com/google/uuid v1.6.0 // indirect + github.com/outrigdev/goid v0.3.0 // indirect +) + replace github.com/wavetermdev/waveterm/tsunami => /Users/mike/work/waveterm/tsunami diff --git a/tsunami/demo/todo/go.sum b/tsunami/demo/todo/go.sum index e69de29bb2..4c44991dfc 100644 --- a/tsunami/demo/todo/go.sum +++ b/tsunami/demo/todo/go.sum @@ -0,0 +1,4 @@ +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/outrigdev/goid v0.3.0 h1:t/otQD3EXc45cLtQVPUnNgEyRaTQA4cPeu3qVcrsIws= +github.com/outrigdev/goid v0.3.0/go.mod h1:hEH7f27ypN/GHWt/7gvkRoFYR0LZizfUBIAbak4neVE= diff --git a/tsunami/demo/tsunamiconfig/go.mod b/tsunami/demo/tsunamiconfig/go.mod index a3118a9ca7..bc485e2ace 100644 --- a/tsunami/demo/tsunamiconfig/go.mod +++ b/tsunami/demo/tsunamiconfig/go.mod @@ -2,4 +2,11 @@ module tsunami/app/tsunamiconfig go 1.25.6 +require github.com/wavetermdev/waveterm/tsunami v0.0.0 + +require ( + github.com/google/uuid v1.6.0 // indirect + github.com/outrigdev/goid v0.3.0 // indirect +) + replace github.com/wavetermdev/waveterm/tsunami => /Users/mike/work/waveterm/tsunami diff --git a/tsunami/demo/tsunamiconfig/go.sum b/tsunami/demo/tsunamiconfig/go.sum index e69de29bb2..4c44991dfc 100644 --- a/tsunami/demo/tsunamiconfig/go.sum +++ b/tsunami/demo/tsunamiconfig/go.sum @@ -0,0 +1,4 @@ +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/outrigdev/goid v0.3.0 h1:t/otQD3EXc45cLtQVPUnNgEyRaTQA4cPeu3qVcrsIws= +github.com/outrigdev/goid v0.3.0/go.mod h1:hEH7f27ypN/GHWt/7gvkRoFYR0LZizfUBIAbak4neVE= From 82d30721a7aa417ec1cce85851d20cde6d4dfc46 Mon Sep 17 00:00:00 2001 From: sawka Date: Fri, 27 Feb 2026 10:08:11 -0800 Subject: [PATCH 8/9] fix and enhance --- cmd/wsh/cmd/wshcmd-debugterm.go | 304 ++++++++++++++++++++++++--- cmd/wsh/cmd/wshcmd-debugterm_test.go | 41 +++- pkg/wshrpc/wshserver/wshserver.go | 2 +- 3 files changed, 309 insertions(+), 38 deletions(-) diff --git a/cmd/wsh/cmd/wshcmd-debugterm.go b/cmd/wsh/cmd/wshcmd-debugterm.go index c314b342e5..501574f7ec 100644 --- a/cmd/wsh/cmd/wshcmd-debugterm.go +++ b/cmd/wsh/cmd/wshcmd-debugterm.go @@ -9,8 +9,10 @@ import ( "encoding/json" "fmt" "io" + "os" "strconv" "strings" + "unicode/utf8" "github.com/spf13/cobra" "github.com/wavetermdev/waveterm/pkg/wshrpc" @@ -20,7 +22,6 @@ import ( const ( DebugTermModeHex = "hex" DebugTermModeDecode = "decode" - DebugTermModeStdin = "stdin" ) var debugTermCmd = &cobra.Command{ @@ -33,14 +34,18 @@ var debugTermCmd = &cobra.Command{ } var ( - debugTermSize int64 - debugTermMode string + debugTermSize int64 + debugTermMode string + debugTermStdin bool + debugTermInput string ) func init() { rootCmd.AddCommand(debugTermCmd) debugTermCmd.Flags().Int64Var(&debugTermSize, "size", 1000, "number of terminal bytes to read") - debugTermCmd.Flags().StringVar(&debugTermMode, "mode", DebugTermModeHex, "output mode: hex, decode, or stdin") + debugTermCmd.Flags().StringVar(&debugTermMode, "mode", DebugTermModeHex, "output mode: hex or decode") + debugTermCmd.Flags().BoolVar(&debugTermStdin, "stdin", false, "read input from stdin instead of rpc call") + debugTermCmd.Flags().StringVar(&debugTermInput, "input", "", "read input from file instead of rpc call") } func debugTermRun(cmd *cobra.Command, args []string) (rtnErr error) { @@ -51,7 +56,7 @@ func debugTermRun(cmd *cobra.Command, args []string) (rtnErr error) { if err != nil { return err } - if mode == DebugTermModeStdin { + if debugTermStdin { stdinData, err := io.ReadAll(WrappedStdin) if err != nil { return fmt.Errorf("reading stdin: %w", err) @@ -60,7 +65,27 @@ func debugTermRun(cmd *cobra.Command, args []string) (rtnErr error) { if err != nil { return err } - WriteStdout("%s", formatDebugTermDecode(termData)) + if mode == DebugTermModeDecode { + WriteStdout("%s", formatDebugTermDecode(termData)) + } else { + WriteStdout("%s", formatDebugTermHex(termData)) + } + return nil + } + if debugTermInput != "" { + fileData, err := os.ReadFile(debugTermInput) + if err != nil { + return fmt.Errorf("reading input file: %w", err) + } + termData, err := parseDebugTermStdinData(fileData) + if err != nil { + return err + } + if mode == DebugTermModeDecode { + WriteStdout("%s", formatDebugTermDecode(termData)) + } else { + WriteStdout("%s", formatDebugTermHex(termData)) + } return nil } if debugTermSize <= 0 { @@ -70,6 +95,7 @@ func debugTermRun(cmd *cobra.Command, args []string) (rtnErr error) { if err != nil { return err } + fmt.Fprintf(os.Stderr, "resolved block %s\n", fullORef) rtn, err := wshclient.DebugTermCommand(RpcClient, wshrpc.CommandDebugTermData{ BlockId: fullORef.OID, Size: debugTermSize, @@ -77,6 +103,7 @@ func debugTermRun(cmd *cobra.Command, args []string) (rtnErr error) { if err != nil { return fmt.Errorf("reading terminal output: %w", err) } + fmt.Fprintf(os.Stderr, "got rtn: %#v\n", rtn) termData, err := base64.StdEncoding.DecodeString(rtn.Data64) if err != nil { return fmt.Errorf("decoding terminal output: %w", err) @@ -92,11 +119,7 @@ func debugTermRun(cmd *cobra.Command, args []string) (rtnErr error) { } func debugTermPreRun(cmd *cobra.Command, args []string) error { - mode, err := getDebugTermMode() - if err != nil { - return err - } - if mode == DebugTermModeStdin { + if debugTermStdin || debugTermInput != "" { return nil } return preRunSetupRpcClient(cmd, args) @@ -104,19 +127,41 @@ func debugTermPreRun(cmd *cobra.Command, args []string) error { func getDebugTermMode() (string, error) { mode := strings.ToLower(debugTermMode) - if mode != DebugTermModeHex && mode != DebugTermModeDecode && mode != DebugTermModeStdin { - return "", fmt.Errorf("invalid mode %q (expected %q, %q, or %q)", debugTermMode, DebugTermModeHex, DebugTermModeDecode, DebugTermModeStdin) + if mode != DebugTermModeHex && mode != DebugTermModeDecode { + return "", fmt.Errorf("invalid mode %q (expected %q or %q)", debugTermMode, DebugTermModeHex, DebugTermModeDecode) } return mode, nil } +type debugTermStdinEntry struct { + Data string `json:"data"` +} + func parseDebugTermStdinData(data []byte) ([]byte, error) { - var arr []string - err := json.Unmarshal(data, &arr) - if err != nil { - return nil, fmt.Errorf("stdin mode expects a JSON array of strings: %w", err) + trimmed := strings.TrimSpace(string(data)) + if len(trimmed) == 0 { + return data, nil + } + if trimmed[0] == '[' { + // try array of structs first + var structArr []debugTermStdinEntry + err := json.Unmarshal(data, &structArr) + if err == nil { + parts := make([]string, len(structArr)) + for i, entry := range structArr { + parts[i] = entry.Data + } + return []byte(strings.Join(parts, "")), nil + } + fmt.Fprintf(os.Stderr, "json read err %v\n", err) + // try array of strings + var strArr []string + err = json.Unmarshal(data, &strArr) + if err == nil { + return []byte(strings.Join(strArr, "")), nil + } } - return []byte(strings.Join(arr, "")), nil + return data, nil } func formatDebugTermHex(data []byte) string { @@ -140,11 +185,11 @@ func formatDebugTermDecode(data []byte) string { switch next { case '[': seq, end := consumeDebugTermCSI(data, i) - lines = append(lines, "CSI "+strconv.QuoteToASCII(string(seq))) + lines = append(lines, formatDebugTermCSILine(seq)) i = end case ']': seq, end := consumeDebugTermOSC(data, i) - lines = append(lines, "OSC "+strconv.QuoteToASCII(string(seq))) + lines = append(lines, formatDebugTermOSCLine(seq)) i = end case 'P': seq, end := consumeDebugTermST(data, i) @@ -170,12 +215,10 @@ func formatDebugTermDecode(data []byte) string { i++ continue } - if isDebugTermTextByte(b) { - start := i - for i < len(data) && isDebugTermTextByte(data[i]) { - i++ - } - lines = append(lines, "TXT "+strconv.QuoteToASCII(string(data[start:i]))) + start, end := consumeDebugTermText(data, i) + if end > start { + lines = append(lines, "TXT "+strconv.Quote(string(data[start:end]))) + i = end continue } lines = append(lines, fmt.Sprintf("CTL 0x%02x", b)) @@ -184,6 +227,165 @@ func formatDebugTermDecode(data []byte) string { return strings.Join(lines, "\n") + "\n" } +var csiCommandDescriptions = map[byte]string{ + '@': "insert character", + 'A': "cursor up", + 'B': "cursor down", + 'C': "cursor forward", + 'D': "cursor back", + 'E': "cursor next line", + 'F': "cursor prev line", + 'G': "cursor horizontal absolute", + 'H': "cursor position", + 'I': "cursor horizontal tab", + 'J': "erase display", + 'K': "erase line", + 'L': "insert line", + 'M': "delete line", + 'P': "delete character", + 'S': "scroll up", + 'T': "scroll down", + 'X': "erase character", + 'Z': "cursor backward tab", + 'a': "cursor horizontal relative", + 'b': "repeat character", + 'c': "device attributes", + 'd': "cursor vertical absolute", + 'e': "cursor vertical relative", + 'f': "horizontal vertical position", + 'g': "tab clear", + 'h': "set mode", + 'l': "reset mode", + 'm': "SGR", + 'n': "device status report", + 'r': "set scrolling region", + 's': "save cursor", + 'u': "restore cursor", +} + +var decModeDescriptions = map[string]string{ + "1": "application cursor keys", + "3": "132 column mode", + "6": "origin mode", + "7": "auto wrap", + "12": "blinking cursor", + "25": "show cursor", + "47": "alternate screen", + "1000": "mouse X10 tracking", + "1002": "mouse button events", + "1003": "mouse all events", + "1004": "focus events", + "1006": "SGR mouse mode", + "1049": "alt screen + save cursor", + "2004": "bracketed paste", + "2026": "synchronized output", +} + +var sgrSingleDescriptions = map[int]string{ + 0: "reset all", + 1: "bold", + 2: "dim", + 3: "italic", + 4: "underline", + 5: "blink", + 7: "reverse", + 8: "hidden", + 9: "strikethrough", + 21: "doubly underlined", + 22: "normal intensity", + 23: "not italic", + 24: "not underlined", + 25: "not blinking", + 27: "not reversed", + 28: "not hidden", + 29: "not strikethrough", + 39: "default fg", + 49: "default bg", +} + +func describeSGR(params string) string { + if params == "" { + return "reset all" + } + parts := strings.Split(params, ";") + if len(parts) >= 5 && parts[0] == "38" && parts[1] == "2" { + return fmt.Sprintf("fg rgb(%s,%s,%s)", parts[2], parts[3], parts[4]) + } + if len(parts) >= 5 && parts[0] == "48" && parts[1] == "2" { + return fmt.Sprintf("bg rgb(%s,%s,%s)", parts[2], parts[3], parts[4]) + } + if len(parts) == 3 && parts[0] == "38" && parts[1] == "5" { + return fmt.Sprintf("fg color256(%s)", parts[2]) + } + if len(parts) == 3 && parts[0] == "48" && parts[1] == "5" { + return fmt.Sprintf("bg color256(%s)", parts[2]) + } + if len(parts) != 1 { + return "" + } + n, err := strconv.Atoi(parts[0]) + if err != nil { + return "" + } + if desc, ok := sgrSingleDescriptions[n]; ok { + return desc + } + if n >= 30 && n <= 37 { + return fmt.Sprintf("fg ansi color %d", n-30) + } + if n >= 40 && n <= 47 { + return fmt.Sprintf("bg ansi color %d", n-40) + } + if n >= 90 && n <= 97 { + return fmt.Sprintf("fg bright color %d", n-90) + } + if n >= 100 && n <= 107 { + return fmt.Sprintf("bg bright color %d", n-100) + } + return "" +} + +func formatDebugTermCSILine(seq []byte) string { + // seq is the full sequence starting with ESC [ + if len(seq) < 3 { + return "CSI " + strconv.QuoteToASCII(string(seq)) + } + inner := seq[2:] + finalByte := inner[len(inner)-1] + params := string(inner[:len(inner)-1]) + + // DEC private mode: params starts with "?" and final byte is 'h' (set) or 'l' (reset) + if strings.HasPrefix(params, "?") && (finalByte == 'h' || finalByte == 'l') { + modeStr := params[1:] + var line string + if finalByte == 'h' { + line = "DEC SET " + modeStr + } else { + line = "DEC RST " + modeStr + } + if desc, ok := decModeDescriptions[modeStr]; ok { + line += " // " + desc + } + return line + } + + finalStr := string([]byte{finalByte}) + var line string + if params == "" { + line = "CSI " + finalStr + } else { + line = "CSI " + finalStr + " " + params + } + if finalByte == 'm' { + if desc := describeSGR(params); desc != "" { + line += " // " + desc + } + } else if desc, ok := csiCommandDescriptions[finalByte]; ok { + line += " // " + desc + } + return line +} + func consumeDebugTermCSI(data []byte, start int) ([]byte, int) { i := start + 2 for i < len(data) { @@ -195,6 +397,25 @@ func consumeDebugTermCSI(data []byte, start int) ([]byte, int) { return data[start:], len(data) } +func formatDebugTermOSCLine(seq []byte) string { + // seq is the full sequence starting with ESC ] + if len(seq) < 3 { + return "OSC " + strconv.QuoteToASCII(string(seq)) + } + // strip ESC ] prefix + inner := string(seq[2:]) + // strip trailing BEL or ST (ESC \) + inner = strings.TrimSuffix(inner, "\x07") + inner = strings.TrimSuffix(inner, "\x1b\\") + // split code from data on first ; + if idx := strings.IndexByte(inner, ';'); idx >= 0 { + code := inner[:idx] + data := inner[idx+1:] + return "OSC " + code + " " + strconv.QuoteToASCII(data) + } + return "OSC " + strconv.QuoteToASCII(inner) +} + func consumeDebugTermOSC(data []byte, start int) ([]byte, int) { i := start + 2 for i < len(data) { @@ -220,6 +441,33 @@ func consumeDebugTermST(data []byte, start int) ([]byte, int) { return data[start:], len(data) } -func isDebugTermTextByte(b byte) bool { - return b == '\n' || b == '\r' || b == '\t' || (b >= 0x20 && b <= 0x7e) +func isDebugTermC0Control(b byte) bool { + return b < 0x20 || b == 0x7f +} + +func consumeDebugTermText(data []byte, i int) (start, end int) { + start = i + for i < len(data) { + b := data[i] + if b == 0x1b || b == 0x07 { + break + } + if b == '\n' || b == '\r' || b == '\t' { + i++ + continue + } + if isDebugTermC0Control(b) { + break + } + if b < 0x80 { + i++ + continue + } + _, sz := utf8.DecodeRune(data[i:]) + if sz == 1 { + break + } + i += sz + } + return start, i } diff --git a/cmd/wsh/cmd/wshcmd-debugterm_test.go b/cmd/wsh/cmd/wshcmd-debugterm_test.go index 2af3d6b976..71d245289f 100644 --- a/cmd/wsh/cmd/wshcmd-debugterm_test.go +++ b/cmd/wsh/cmd/wshcmd-debugterm_test.go @@ -20,11 +20,11 @@ func TestFormatDebugTermDecode(t *testing.T) { output := formatDebugTermDecode(data) expected := []string{ `TXT "abc"`, - `CSI "\x1b[31m"`, + `CSI m 31`, `TXT "red"`, - `CSI "\x1b[0m"`, + `CSI m 0`, `BEL`, - `OSC "\x1b]0;title\a"`, + `OSC 0 "title"`, `CTL 0x00`, } for _, line := range expected { @@ -42,9 +42,9 @@ func TestParseDebugTermStdinData(t *testing.T) { output := formatDebugTermDecode(data) expected := []string{ `TXT "abc"`, - `CSI "\x1b[31m"`, + `CSI m 31`, `TXT "red"`, - `CSI "\x1b[0m"`, + `CSI m 0`, } for _, line := range expected { if !strings.Contains(output, line) { @@ -53,9 +53,32 @@ func TestParseDebugTermStdinData(t *testing.T) { } } -func TestParseDebugTermStdinDataInvalid(t *testing.T) { - _, err := parseDebugTermStdinData([]byte(`{"not":"array"}`)) - if err == nil { - t.Fatalf("expected error for invalid stdin json") +func TestParseDebugTermStdinDataStructs(t *testing.T) { + data, err := parseDebugTermStdinData([]byte(`[{"data":"abc"},{"data":"\u001b[31mred"},{"data":"\u001b[0m"}]`)) + if err != nil { + t.Fatalf("parseDebugTermStdinData() error: %v", err) + } + output := formatDebugTermDecode(data) + expected := []string{ + `TXT "abc"`, + `CSI m 31`, + `TXT "red"`, + `CSI m 0`, + } + for _, line := range expected { + if !strings.Contains(output, line) { + t.Fatalf("missing decode line %q in output %q", line, output) + } + } +} + +func TestParseDebugTermStdinDataRaw(t *testing.T) { + raw := []byte("hello\x1b[31mworld") + data, err := parseDebugTermStdinData(raw) + if err != nil { + t.Fatalf("parseDebugTermStdinData() error: %v", err) + } + if string(data) != string(raw) { + t.Fatalf("expected raw passthrough, got %q", data) } } diff --git a/pkg/wshrpc/wshserver/wshserver.go b/pkg/wshrpc/wshserver/wshserver.go index c10f7553b3..cdb7abe022 100644 --- a/pkg/wshrpc/wshserver/wshserver.go +++ b/pkg/wshrpc/wshserver/wshserver.go @@ -826,7 +826,7 @@ func (ws *WshServer) DebugTermCommand(ctx context.Context, data wshrpc.CommandDe if readSize > dataLength { readSize = dataLength } - readOffset := dataLength - readSize + readOffset := waveFile.Size - readSize readOffset, readData, err := filestore.WFS.ReadAt(ctx, data.BlockId, wavebase.BlockFile_Term, readOffset, readSize) if err != nil { return nil, fmt.Errorf("error reading term file: %w", err) From 2dec59b157b7fce82251d8e21755c2aaca689963 Mon Sep 17 00:00:00 2001 From: sawka Date: Fri, 27 Feb 2026 10:20:40 -0800 Subject: [PATCH 9/9] formatting improvements --- cmd/wsh/cmd/wshcmd-debugterm.go | 84 +++++++++++++++++++++++++++- cmd/wsh/cmd/wshcmd-debugterm_test.go | 16 ++++++ 2 files changed, 98 insertions(+), 2 deletions(-) diff --git a/cmd/wsh/cmd/wshcmd-debugterm.go b/cmd/wsh/cmd/wshcmd-debugterm.go index 501574f7ec..c144c35dbe 100644 --- a/cmd/wsh/cmd/wshcmd-debugterm.go +++ b/cmd/wsh/cmd/wshcmd-debugterm.go @@ -168,15 +168,81 @@ func formatDebugTermHex(data []byte) string { return hex.Dump(data) } +func parseCursorForwardN(seq []byte) (int, bool) { + if len(seq) < 3 || seq[len(seq)-1] != 'C' { + return 0, false + } + params := string(seq[2 : len(seq)-1]) + if params == "" { + return 1, true + } + n, err := strconv.Atoi(params) + if err != nil || n <= 0 { + return 0, false + } + return n, true +} + +// splitOnCRLFRuns splits s at the end of each run of \r and \n characters. +// Each segment includes its trailing CR/LF run. The last segment may have no such run. +func splitOnCRLFRuns(s string) []string { + var result []string + for len(s) > 0 { + // find start of next CR/LF run + i := 0 + for i < len(s) && s[i] != '\r' && s[i] != '\n' { + i++ + } + if i == len(s) { + break + } + // consume the CR/LF run + j := i + for j < len(s) && (s[j] == '\r' || s[j] == '\n') { + j++ + } + result = append(result, s[:j]) + s = s[j:] + } + if len(s) > 0 { + result = append(result, s) + } + return result +} + func formatDebugTermDecode(data []byte) string { if len(data) == 0 { return "" } lines := make([]string, 0) + // textBuf accumulates text across CSI-C (cursor forward) sequences so consecutive + // "word CSI-C word" runs collapse into a single TXT line. The // NC annotation goes + // on the last segment only. + textBuf := "" + totalCSpaces := 0 + flushText := func() { + if textBuf == "" && totalCSpaces == 0 { + return + } + segs := splitOnCRLFRuns(textBuf) + if len(segs) == 0 { + segs = []string{textBuf} + } + for i, seg := range segs { + if i == len(segs)-1 && totalCSpaces > 0 { + lines = append(lines, fmt.Sprintf("TXT %s // %dC", strconv.Quote(seg), totalCSpaces)) + } else { + lines = append(lines, "TXT "+strconv.Quote(seg)) + } + } + textBuf = "" + totalCSpaces = 0 + } for i := 0; i < len(data); { b := data[i] if b == 0x1b { if i+1 >= len(data) { + flushText() lines = append(lines, "ESC") i++ continue @@ -185,25 +251,36 @@ func formatDebugTermDecode(data []byte) string { switch next { case '[': seq, end := consumeDebugTermCSI(data, i) - lines = append(lines, formatDebugTermCSILine(seq)) + if n, ok := parseCursorForwardN(seq); ok { + textBuf += strings.Repeat(" ", n) + totalCSpaces += n + } else { + flushText() + lines = append(lines, formatDebugTermCSILine(seq)) + } i = end case ']': + flushText() seq, end := consumeDebugTermOSC(data, i) lines = append(lines, formatDebugTermOSCLine(seq)) i = end case 'P': + flushText() seq, end := consumeDebugTermST(data, i) lines = append(lines, "DCS "+strconv.QuoteToASCII(string(seq))) i = end case '^': + flushText() seq, end := consumeDebugTermST(data, i) lines = append(lines, "PM "+strconv.QuoteToASCII(string(seq))) i = end case '_': + flushText() seq, end := consumeDebugTermST(data, i) lines = append(lines, "APC "+strconv.QuoteToASCII(string(seq))) i = end default: + flushText() seq := data[i : i+2] lines = append(lines, "ESC "+strconv.QuoteToASCII(string(seq))) i += 2 @@ -211,19 +288,22 @@ func formatDebugTermDecode(data []byte) string { continue } if b == 0x07 { + flushText() lines = append(lines, "BEL") i++ continue } start, end := consumeDebugTermText(data, i) if end > start { - lines = append(lines, "TXT "+strconv.Quote(string(data[start:end]))) + textBuf += string(data[start:end]) i = end continue } + flushText() lines = append(lines, fmt.Sprintf("CTL 0x%02x", b)) i++ } + flushText() return strings.Join(lines, "\n") + "\n" } diff --git a/cmd/wsh/cmd/wshcmd-debugterm_test.go b/cmd/wsh/cmd/wshcmd-debugterm_test.go index 71d245289f..eba2caeb7d 100644 --- a/cmd/wsh/cmd/wshcmd-debugterm_test.go +++ b/cmd/wsh/cmd/wshcmd-debugterm_test.go @@ -72,6 +72,22 @@ func TestParseDebugTermStdinDataStructs(t *testing.T) { } } +func TestFormatDebugTermDecodeCursorForward(t *testing.T) { + // CSI C sequences collapse into adjacent text; all consecutive text+CSI-C runs merge into one TXT line. + // The run is split into separate TXT lines at CR/LF run boundaries; // NC appears on the last line. + data := []byte("hi\x1b[1Cworld\x1b[3Cfoo\r\nbar") + output := formatDebugTermDecode(data) + expected := []string{ + `TXT "hi world foo\r\n"`, + `TXT "bar" // 4C`, + } + for _, line := range expected { + if !strings.Contains(output, line) { + t.Fatalf("missing decode line %q in output:\n%s", line, output) + } + } +} + func TestParseDebugTermStdinDataRaw(t *testing.T) { raw := []byte("hello\x1b[31mworld") data, err := parseDebugTermStdinData(raw)