Cannot disable spinner
The spinner in heroku run output cannot be disabled with CI=true or TERM=dumb.
This has been raised in https://github.com/heroku/cli/issues/3023 but closed as "This issue will be resolved in our next major release".
It still has not been fixed in 10.4.1 (closed around 9.4.0)
That's a limitation because of a bug in the Oclif Core version being leveraged nowadays. There are ongoing efforts to migrate our Heroku CLI and plugins to a more recent version of Oclif Core that will solve this issue, but it's a long term project that spans over multiple months this year due to the amount of work involved.
I'll suggest keeping an eye on Heroku's Changelog for updates regarding major CLI releases.
Why is this being closed as completed if it's an ongoing effort? I was already confused and spent extra time verifying I'm not making mistakes, because the previous issue was closed with a promise of the next major release.
We're closing the report because we can't commit yet to a specific version where the Oclif Core version will be updated in Heroku CLI fixing this issue.
We had plans to do this update for our current major version, but that ended up not being possible, due to the limitations that there are over 50 Heroku CLI plugins that need to be updated first.
We can keep this open, if you prefer, until that project is done. But be aware that we cannot fix it right now.
Hi @viraptor 👋
For context, the defect is located here in the config.ts. As you can see, the imports on lines 3 and 4 reference the same spinner.
Our contact and the primary maintainer for Oclif is out on maternity leave for the next several months. The last discussion I had with the oclif team wasn't conclusive. Due to the age of the defective version, it is unlikely they will provide a patch fix.
The workaround is to patch this manually directly in source code for the installed CLI:
- use
where herokuto determine the CLI install location - Back up a few directories and open
lib/node_modules/heroku/node_modules/@oclif/core/lib/cli-ux/config.js - Replace the following:
const spinner_1 = require("./action/spinner");
const spinner_2 = require("./action/spinner");
With this:
const spinner_1 = require("./action/spinner");
const spinner_2 = require("./action/simple");
Sorry for the manual workaround and for the confusion on this. I'll continue to work with the oclif team to get this resolved since it looks like it may be some time before we can update the oclif core version in the Heroku CLI.
for those who are looking for a workaround, this seems to work well:
#!/usr/bin/env bash
set -eo pipefail # make sure we get non-zero exit code when heroku command fails
heroku_cli() {
# workaround to disable the annoying spinner that clutters logs
# <https://github.com/heroku/cli/issues/3269>
heroku "$@" 2>&1 | grep --invert-match --perl-regexp '[⣟⣯⣷⣾⣽⣻⢿⡿]'
}
heroku_cli pg:copy ...
@justinwilaby is this fixed in version 11 that has upgraded oclif ?
@viraptor & @stof I have confirmed that this has been resolved in the latest CLI v11 release. I verified that the spinner in heroku run output is disabled using either CI=true or TERM=dumb.