{"record":{"id":"1362bef794844385","repo":"wavetermdev/waveterm","slug":"cannot-use-replace-and-magnified-together","errorCode":null,"errorMessage":"cannot use --replace and --magnified together","messagePattern":"cannot use --replace and --magnified together","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/wsh/cmd/wshcmd-web.go","lineNumber":112,"sourceCode":"\t}\n\treturn nil\n}\n\nfunc webOpenRun(cmd *cobra.Command, args []string) (rtnErr error) {\n\tdefer func() {\n\t\tsendActivity(\"web\", rtnErr == nil)\n\t}()\n\n\tvar replaceBlockORef *waveobj.ORef\n\tif webOpenReplaceBlock != \"\" {\n\t\tvar err error\n\t\treplaceBlockORef, err = resolveSimpleId(webOpenReplaceBlock)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"resolving -r blockid: %w\", err)\n\t\t}\n\t}\n\tif replaceBlockORef != nil && webOpenMagnified {\n\t\treturn fmt.Errorf(\"cannot use --replace and --magnified together\")\n\t}\n\n\ttabId := getTabIdFromEnv()\n\tif tabId == \"\" {\n\t\treturn fmt.Errorf(\"no WAVETERM_TABID env var set\")\n\t}\n\n\twshCmd := wshrpc.CommandCreateBlockData{\n\t\tTabId: tabId,\n\t\tBlockDef: &waveobj.BlockDef{\n\t\t\tMeta: map[string]any{\n\t\t\t\twaveobj.MetaKey_View: \"web\",\n\t\t\t\twaveobj.MetaKey_Url:  args[0],\n\t\t\t},\n\t\t},\n\t\tMagnified: webOpenMagnified,\n\t\tFocused:   true,\n\t}","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/cmd/wsh/cmd/wshcmd-web.go#L94-L130","documentation":"Returned by wsh web when both --replace and --magnified flags are set; they are mutually exclusive viewing modes.","triggerScenarios":"`wsh web open <url> --replace <oid> --magnified` — replaceBlockORef resolved successfully but webOpenMagnified is also true.","commonSituations":"Combining flags from an old command alias or script; misunderstanding that a replaced block cannot also be magnified.","solutions":["Drop --magnified when replacing a block","Drop --replace when a magnified new block is desired","Split into two commands if both behaviors are needed"],"exampleFix":"// before\nwsh web open https://example.com --replace abc --magnified\n// after\nwsh web open https://example.com --replace abc","handlingStrategy":"validation","validationCode":"if webOpenReplaceBlock != \"\" && webOpenMagnified {\n    return errors.New(\"cannot use --replace and --magnified together\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Document mutually exclusive flags in scripts","Check `wsh web open --help` before composing flag sets","Wrap common flag combos in shell functions"],"tags":["cli","flag-conflict","usage"],"backgroundTag":"mutually-exclusive-flags","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}