Commit b2f3129
Add
`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>wsh debugterm (#2947)1 parent c5afeb8 commit b2f3129
File tree
7 files changed
+717
-0
lines changed- cmd/wsh/cmd
- frontend
- app/store
- types
- pkg/wshrpc
- wshclient
- wshserver
7 files changed
+717
-0
lines changed
0 commit comments