flathub-infra / ide-flatpak-wrapper

Wrapper for setting up development environment in flatpak sandbox
MIT License
14 stars 12 forks source link

Wrapper is probably spamming terminal when invoking n vim #12

Open florianb opened 2 years ago

florianb commented 2 years ago

Hi - i am pretty new to the flathub universe. So it might be i ended up in the wrong repo regarding this issue.

I installed Neovim using Flathub. When running io.neovim.nvim the shell prints three additional lines regarding the wrapper:

❯ nvim
nvim-wrapper-wrapper: Setting up NPM packages
nvim-wrapper-wrapper: Setting up Cargo packages
nvim-wrapper-wrapper: Setting up Python packages

So in that regard:

Is it possible to mute these wrapper mesages?

If not would this be the right place to discuss this, and would a PR be possible be accepted?

Thanks in advance – Florian

gasinvein commented 2 years ago

A patch adding an option to suppress the messages would be nice, yes.

florianb commented 2 years ago

I would happily provide a PR. What would you say is a good approach?

  1. Removing the the output per default allowing a debug-specific opt-in,
  2. Keeping the functionality as it is providing a opt-out, or
  3. Trying to make a educated guess about the calling surroundings (not sure if this possible, though) and try to switch the message smartly?

I am fairly new to Flathub so i have to dig into the overall functionality to get an idea about a possible idiomatic approach. So any hints are welcome.

gasinvein commented 2 years ago

Providing opt-out seems fine. If printing debug messages is controlled by an environment variable, it's default value can be easily altered in the app finish-args.

florianb commented 2 years ago

Awesome - i would then propose introducing FLATPAK_IDE_QUIET:0 as a mix of FLATPAK_IDE_ENV and the widely used quiet option.

If you're fine i'd open a PR.

gasinvein commented 2 years ago

I'd rather have it the other way round - something like FLATPAK_IDE_LOGLEVEL with values 0 for "quiet", 1 by default for current behaviour. And then greater numbers can be used in future for more verbose logging.

florianb commented 2 years ago

Aye - i create a PR. :)

CleoMenezesJr commented 1 year ago

I just merged the PR https://github.com/flathub/io.neovim.nvim/pull/57 which implements https://github.com/flathub/ide-flatpak-wrapper/pull/17.