waveterm/frontend
Copilot b2f3129aa0
Add wsh debugterm (#2947)
`wsh debugterm` currently decodes terminal bytes sourced from backend
block files. This extends it with a stdin-driven path so FE-emitted
payloads like `["...", "..."]` can be decoded directly without requiring
block lookup/RPC in that mode.

- **CLI surface**
  - Added new mode: `--mode stdin`
  - Updated mode help text to: `hex`, `decode`, `stdin`
  - Centralized mode validation via `getDebugTermMode()`

- **Execution path split**
  - Added mode-aware pre-run (`debugTermPreRun`):
    - `stdin` mode: skips RPC setup
    - `hex`/`decode`: keeps existing RPC setup behavior
  - `stdin` mode now:
    - reads all stdin
    - parses JSON as `[]string`
    - concatenates entries and runs existing decode formatter

- **Parsing support**
  - Added `parseDebugTermStdinData([]byte) ([]byte, error)`
  - Error messaging explicitly requires a JSON array of strings

- **Tests**
  - Added focused coverage for:
    - valid stdin JSON array parsing + decoded output
    - invalid stdin JSON input

```go
stdinData, _ := io.ReadAll(WrappedStdin)
termData, err := parseDebugTermStdinData(stdinData) // expects []string JSON
if err != nil { return err }
WriteStdout("%s", formatDebugTermDecode(termData))
```

<!-- START COPILOT CODING AGENT TIPS -->
---

 Let Copilot coding agent [set things up for
you](https://github.com/wavetermdev/waveterm/issues/new?title=+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
Co-authored-by: sawka <mike@commandline.dev>
2026-02-27 10:24:26 -08:00
..
app Add wsh debugterm (#2947) 2026-02-27 10:24:26 -08:00
builder Refactor ContextMenuModel to lazy singleton via getInstance() and update all call sites (#2920) 2026-02-23 13:42:02 -08:00
layout update eslint to v9 (and fix all eslint errors) (#2923) 2026-02-23 18:42:17 -08:00
preview remove orphaned style.scss, make windowtype.ts, small CSS cleanup (#2939) 2026-02-25 16:07:13 -08:00
types Add wsh debugterm (#2947) 2026-02-27 10:24:26 -08:00
util update eslint to v9 (and fix all eslint errors) (#2923) 2026-02-23 18:42:17 -08:00
tailwindsetup.css New ConnMonitor to Track "Stalled" Connection State for SSH Conns (#2846) 2026-02-09 17:11:55 -08:00
wave.ts Remove unused frontend notification system and dev-only updater notification UI (#2929) 2026-02-24 12:49:13 -08:00