foxundermoon / vs-shell-format

the shellscript、Dockerfile、properties ...... format extension
MIT License
450 stars 50 forks source link

Do not steal focus when installing shell format binary #381

Open stewartadam opened 5 months ago

stewartadam commented 5 months ago

After installing the extension, it steals focus to open up the output window and present download progress:

shfmt hasn't downloaded yet!Error: ENOENT: no such file or directory, stat '/home/vscode/.vscode-server/extensions/foxundermoon.shell-format-7.2.5/bin/shfmt_v3.6.0_linux_arm64'
Shfmt will be downloaded automatically!
download url: https://github.com/mvdan/sh/releases/download/v3.6.0/shfmt_v3.6.0_linux_arm64
download to: /home/vscode/.vscode-server/extensions/foxundermoon.shell-format-7.2.5/bin/shfmt_v3.6.0_linux_arm64
If the download fails, you can manually download it to the dest directory.
Or download to another directory, and then set the "shellformat.path" as the path
download shfmt page: https://github.com/mvdan/sh/releases
You can't use this plugin until the download is successful.
downloaded:[0.05%]
downloaded:[0.10%]
downloaded:[0.15%]
...

There isn't really much actionable here, it should be logged but should not steal focus. This is particularly annoying for dev containers because every startup, the focus is stolen away from the active terminal or file being edited after ~1 minute as extensions are initialized in the background.