Skip to content

Commit c6ab2eb

Browse files
authored
fix: prevent spinner from interfering with 2FA prompt in heroku run and heroku console (#3545)
fix: prevent spinner from interfering with 2FA prompt in heroku run Moved the "Running <command> on <app>" status message to display after the dyno is successfully created, rather than before the API call. This ensures the spinner doesn't interfere with inquirer's readline interface when a 2FA prompt is displayed during the dyno creation POST request. Previously, the spinner would start before the API call, and if 2FA was required, inquirer would try to prompt while the spinner was still active, causing the prompt to be reprinted on every keystroke.
1 parent a1a4ece commit c6ab2eb

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/lib/run/dyno.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,6 @@ export default class Dyno extends Duplex {
103103
// Starts the dyno
104104
async start() {
105105
this._startedAt = Date.now()
106-
if (this.opts.showStatus) {
107-
ux.action.start(`Running ${color.code(this.opts.command)} on ${color.app(this.opts.app)}`)
108-
}
109-
110106
await this._doStart()
111107
}
112108

@@ -178,6 +174,12 @@ export default class Dyno extends Duplex {
178174
})
179175
// @ts-ignore
180176
this.dyno = dyno.body
177+
178+
// Show status after dyno is created (after any 2FA prompt)
179+
if (this.opts.showStatus) {
180+
ux.action.start(`Running ${color.code(this.opts.command)} on ${color.app(this.opts.app)}`)
181+
}
182+
181183
if (this.opts.attach || this.opts.dyno) {
182184
// @ts-ignore
183185
if (this.dyno.name && this.opts.dyno === undefined) {

0 commit comments

Comments
 (0)