{"record":{"id":"ee742295c77a9729","repo":"wavetermdev/waveterm","slug":"active-border-color-v","errorCode":null,"errorMessage":"--active-border-color: %v","messagePattern":"--active-border-color: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/wsh/cmd/wshcmd-setbg.go","lineNumber":106,"sourceCode":"\treturn nil\n}\n\nfunc setBgRun(cmd *cobra.Command, args []string) (rtnErr error) {\n\tdefer func() {\n\t\tsendActivity(\"setbg\", rtnErr == nil)\n\t}()\n\n\tborderColorChanged := cmd.Flags().Changed(\"border-color\")\n\tactiveBorderColorChanged := cmd.Flags().Changed(\"active-border-color\")\n\n\tif borderColorChanged {\n\t\tif err := validateColor(setBgBorderColor); err != nil {\n\t\t\treturn fmt.Errorf(\"--border-color: %v\", err)\n\t\t}\n\t}\n\tif activeBorderColorChanged {\n\t\tif err := validateColor(setBgActiveBorderColor); err != nil {\n\t\t\treturn fmt.Errorf(\"--active-border-color: %v\", err)\n\t\t}\n\t}\n\n\t// Create base metadata\n\tmeta := map[string]interface{}{}\n\n\t// Handle opacity-only change or clear\n\tif len(args) == 0 {\n\t\tif !cmd.Flags().Changed(\"opacity\") && !setBgClear && !borderColorChanged && !activeBorderColorChanged {\n\t\t\tOutputHelpMessage(cmd)\n\t\t\treturn fmt.Errorf(\"setbg requires an image path or color value\")\n\t\t}\n\t\tif setBgOpacity < 0 || setBgOpacity > 1 {\n\t\t\treturn fmt.Errorf(\"opacity must be between 0.0 and 1.0\")\n\t\t}\n\t\tif setBgClear {\n\t\t\tmeta[\"bg:*\"] = true\n\t\t} else if cmd.Flags().Changed(\"opacity\") {","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/cmd/wsh/cmd/wshcmd-setbg.go#L88-L124","documentation":"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.","triggerScenarios":"Any `wsh setbg --active-border-color <invalid>` invocation where the value is not '#' hex (6 or 8 digits) nor a CSS color name.","commonSituations":"Same as border-color mistakes: missing '#', 3-digit hex, non-hex digits, unknown color names.","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."],"exampleFix":"// before\nwsh setbg --active-border-color '#3366f'  \n// after\nwsh setbg --active-border-color '#3366FF'","handlingStrategy":"validation","validationCode":"if abc := flags[\"--active-border-color\"]; abc != \"\" && !isAcceptableColor(abc) {\n    return fmt.Errorf(\"--active-border-color %q invalid: use '#RRGGBB', '#RRGGBBAA', or a CSS name\", abc)\n}","typeGuard":"func isAcceptableColor(c string) bool {\n    if strings.HasPrefix(c, \"#\") { return regexp.MustCompile(`^#[0-9a-fA-F]{6}([0-9a-fA-F]{2})?$`).MatchString(c) }\n    return CssColorNames[strings.ToLower(c)]\n}","tryCatchPattern":"if err := run(); err != nil {\n    if strings.Contains(err.Error(), \"--active-border-color\") { /* correct the active-border-color value */ }\n}","preventionTips":["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."],"tags":["cli","validation","color","flags"],"backgroundTag":"invalid-color-format","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}