Open source AI coding agent. Designed for large projects and real world tasks.
Go aiai-agentsai-developer-toolsai-toolsclicommand-linedeveloper-toolsgitgolanggpt-4llmopenaipolyglot-programmingterminalterminal-basedterminal-ui
tell --editor flag/config handling
Dane Schneiderd299452b38ac
diff --git a/app/cli/cmd/plan_exec_helpers.go b/app/cli/cmd/plan_exec_helpers.goindex 772836b3..823dd695 100644--- a/app/cli/cmd/plan_exec_helpers.go+++ b/app/cli/cmd/plan_exec_helpers.go@@ -33,14 +33,16 @@ var noExec boolvar autoDebug intvar editor string+var editorSetByFlag boolfunc init() {- defaultEditor = os.Getenv("EDITOR")- if defaultEditor == "" {- defaultEditor = os.Getenv("VISUAL")- if defaultEditor == "" {- defaultEditor = string(defaultEditor)- }+ envEditor := os.Getenv("EDITOR")+ if envEditor == "" {+ envEditor = os.Getenv("VISUAL")+ }++ if envEditor != "" {+ defaultEditor = envEditor}}@@ -175,6 +177,10 @@ func mustSetPlanExecFlags(cmd *cobra.Command) {}}+ if !editorSetByFlag {+ editor = config.Editor+ }+validatePlanExecFlags()}@@ -221,7 +227,7 @@ type editorValue struct {}func newEditorValue(p *string) *editorValue {- *p = "" // Default to empty string+ *p = defaultEditorreturn &editorValue{p}}@@ -231,6 +237,7 @@ func (f *editorValue) Set(s string) error {return nil}*f.value = s+ editorSetByFlag = truereturn nil}