Skip to content

Commit c392f6d

Browse files
committed
When running a program with Python / Poetry / Flask, also save the cmd
1 parent 5238f17 commit c392f6d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

v2/run.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,12 @@ func (e *Editor) Run() (string, bool, error) {
137137
if isDarwin {
138138
cmd.Args[2] = "python3"
139139
}
140-
141140
}
142141
} else {
143142
cmd = exec.Command("python", sourceFilename)
144143
if isDarwin {
145144
cmd.Args[0] = "python3"
146145
}
147-
148146
}
149147
allEnv = append(allEnv, "PYTHONUTF8=1")
150148
if !files.Exists(pyCacheDir) {
@@ -178,6 +176,11 @@ func (e *Editor) Run() (string, bool, error) {
178176
// Set the command environment to the parent environment + changes
179177
cmd.Env = allEnv
180178

179+
// For Python, save the run command
180+
if e.mode == mode.Python {
181+
saveCommand(cmd)
182+
}
183+
181184
output, err := CombinedOutputSetPID(cmd)
182185

183186
if e.mode != mode.ABC && err == nil { // success

0 commit comments

Comments
 (0)