wavetermdev/waveterm · error
--active-border-color: %v
Error message
--active-border-color: %v
What it means
Identical wrapper to error 247 but for the --active-border-color flag: when the flag is provided, its value is run through validateColor and failures are prefixed with "--active-border-color: ". The wrapped inner error indicates the specific validation rule that failed.
Source
Thrown at cmd/wsh/cmd/wshcmd-setbg.go:106
return nil
}
func setBgRun(cmd *cobra.Command, args []string) (rtnErr error) {
defer func() {
sendActivity("setbg", rtnErr == nil)
}()
borderColorChanged := cmd.Flags().Changed("border-color")
activeBorderColorChanged := cmd.Flags().Changed("active-border-color")
if borderColorChanged {
if err := validateColor(setBgBorderColor); err != nil {
return fmt.Errorf("--border-color: %v", err)
}
}
if activeBorderColorChanged {
if err := validateColor(setBgActiveBorderColor); err != nil {
return fmt.Errorf("--active-border-color: %v", err)
}
}
// Create base metadata
meta := map[string]interface{}{}
// Handle opacity-only change or clear
if len(args) == 0 {
if !cmd.Flags().Changed("opacity") && !setBgClear && !borderColorChanged && !activeBorderColorChanged {
OutputHelpMessage(cmd)
return fmt.Errorf("setbg requires an image path or color value")
}
if setBgOpacity < 0 || setBgOpacity > 1 {
return fmt.Errorf("opacity must be between 0.0 and 1.0")
}
if setBgClear {
meta["bg:*"] = true
} else if cmd.Flags().Changed("opacity") {View on GitHub (pinned to a4447c1563)
Solutions
- Quote and use full hex: `wsh setbg --active-border-color '#3366FF'`.
- Or a CSS color name: `--active-border-color blue`.
- Read the wrapped cause after the prefix for the exact rule violated.
Example fix
// before wsh setbg --active-border-color '#3366f' // after wsh setbg --active-border-color '#3366FF'
Defensive patterns
Strategy: validation
Validate before calling
if abc := flags["--active-border-color"]; abc != "" && !isAcceptableColor(abc) {
return fmt.Errorf("--active-border-color %q invalid: use '#RRGGBB', '#RRGGBBAA', or a CSS name", abc)
} Type guard
func isAcceptableColor(c string) bool {
if strings.HasPrefix(c, "#") { return regexp.MustCompile(`^#[0-9a-fA-F]{6}([0-9a-fA-F]{2})?$`).MatchString(c) }
return CssColorNames[strings.ToLower(c)]
} Try / catch
if err := run(); err != nil {
if strings.Contains(err.Error(), "--active-border-color") { /* correct the active-border-color value */ }
} Prevention
- Use full 6/8-digit hex for the active border color.
- Quote arguments to protect '#' from shell comment parsing.
- Test the command with a known-good value like '#0000FF' first.
When it happens
Trigger: Any `wsh setbg --active-border-color <invalid>` invocation where the value is not '#' hex (6 or 8 digits) nor a CSS color name.
Common situations: Same as border-color mistakes: missing '#', 3-digit hex, non-hex digits, unknown color names.
Related errors
- --border-color: %v
- --workspace and --window are mutually exclusive; specify onl
- color must start with #
- color must be in #RRGGBB or #RRGGBBAA format
- invalid hex color: %v
AI-assisted analysis of wavetermdev/waveterm@a4447c1563 (2026-09-01).
Data as JSON: /api/errors/ee742295c77a9729.
Report an issue: GitHub.