Skip to content

feat: term block command config dialog with Save & Restart and error state display#9

Merged
lyx-tec merged 3 commits into
mainfrom
feat/term-cmd-config
Jun 7, 2026
Merged

feat: term block command config dialog with Save & Restart and error state display#9
lyx-tec merged 3 commits into
mainfrom
feat/term-cmd-config

Conversation

@lyx-tec

@lyx-tec lyx-tec commented Jun 6, 2026

Copy link
Copy Markdown
Owner

Summary

Add a command configuration dialog for terminal blocks, allowing users to configure startup commands, environment variables, and other settings at runtime.

Changes

Backend

  • pkg/waveobj/wtypemeta.go: Add MetaKey_CmdLastError field
  • pkg/waveobj/metaconsts.go: Generated constants update
  • pkg/blockcontroller/shellcontroller.go:
    • Write cmd:lasterror on non-zero exit code, clear on exit 0
    • Inject configured command as keystrokes into interactive shell (stays interactive after execution)

Frontend

  • CommandConfigModal.tsx/scss: New dialog with 4 fields (Command textarea, Run on startup, Clear on start, Environment Variables), validation, Save & Restart flow
  • term-model.ts: Replace 'Run On Startup' submenu with single 'Configure Command...' item; show red error icon in block header when cmd:lasterror is set
  • modalregistry.tsx: Register CommandConfigModal
  • gotypes.d.ts: Add CmdLastError to WaveMetaKey

Key Design Decision

Command is injected as keystrokes into the interactive shell (not via -c\ flag), so the shell remains interactive after command execution.

Testing

  • Built MSI: \make/Wave-win32-x64-0.14.5.msi\
  • Manual verification of dialog flow, Save & Restart, error state display, and command injection pending

lyx-tec added 3 commits June 6, 2026 11:28
…state display

- Add CommandConfigModal dialog (Command, Run on startup, Clear on start, Env vars)
- Replace 'Run On Startup' submenu with 'Configure Command...' menu item
- Inject command as keystrokes into interactive shell (not -c mode)
- Write cmd:lasterror meta key on non-zero exit, clear on exit 0
- Show red error icon in block header when cmd:lasterror is set
- Add MetaKey_CmdLastError to MetaTSType / metaconsts.go
… error icon guard

- Clear cmd:lasterror meta at shell start and before each injection
- Add shell-specific env var injection (export for bash, envvar for pwsh, set -gx for fish)
- Fix error icon: only set cmd:lasterror when InjectedCommand flag is true
- Use backslash-r (0x0D) instead of backslash-r-backslash-n for ConPTY keystroke injection
- Add 1500ms delay for shell raw mode initialization
- Convert backslash-n to backslash-r for multi-line command injection
- Add clickable error icon that opens MessageModal with details
- Set controller double-quote shell double-quote in Save and Restart meta (was null)
- Update OpenSpec skills-workflows to v1.4.1
- Replace direct PTY write with shellInputCh channel (same path as user keystrokes)
- Remove InjectedCommand tracking and cmd:lasterror meta mechanism
- Remove red error icon UI for cmd blocks
- Remove MetaKey_CmdLastError/CmdLastError type and generated files
- Clean up unused useEffect import
- Rename 'Configure Command...' to 'Startup Command...'
@lyx-tec lyx-tec merged commit abd4236 into main Jun 7, 2026
4 of 6 checks passed
@lyx-tec lyx-tec deleted the feat/term-cmd-config branch June 7, 2026 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant