Configuration not working for browser and editor
Checklist
-
I'm using the latest version of the extension (Run glab --version
)- Extension version: glab version 1.36.0 (2023-12-13)
-
Operating system and version: Fedora 39 (Sericea) inside Toolbox container -
Gitlab.com or self-managed instance? gitlab.com -
GitLab version (if self-managed) GitLab version here (Use the version
endpoint, like this: gitlab.my-company.com/api/v4/version) -
I have performed glab auth status
to check for authentication issues
Summary
glab config set browser <anything>
or glab config set editor <anything>
doesn't do anything, the config file will keep the empty browser:
and editor:
lines and when I use glab config get browser
I get the value from the BROWSER
env variable. Similarly with glab config get editor
I get the value from the EDITOR
env variable. And even if I manually add the values to the config file, they are ignored and glab continues to use whatever the env variables set.
This is against the description that says to default to env vars only if the configs are not set
- browser: if unset, defaults to environment variables
- editor: if unset, defaults to environment variables
Environment
- OS: Linux 6.7.7-200.fc39.x86_64 x86_64
- SHELL: /usr/bin/zsh
- TERM: xterm-256color
- GLAB: glab version 1.36.0 (2023-12-13)
Other:
- Fedora toolbox
registry.fedoraproject.org/fedora-toolbox:39
- ZSH with oh-my-zsh
Steps to reproduce
➜ glab config get browser
/usr/bin/firefox
➜ grep ^browser: ~/.config/glab-cli/config.yml
browser: /usr/bin/vimb
➜ glab config set browser /usr/bin/chromium
➜ glab config get browser
/usr/bin/firefox
➜ grep ^browser: ~/.config/glab-cli/config.yml
browser: /usr/bin/vimb
➜ BROWSER=whatever glab config get browser
whatever
And you can do the same with editor
, not working either.
What is the current bug behavior?
-
glab config set (browser|editor)
not working at all, not updating the config file and silently ignoring the value I set. -
glab config get (browser|editor)
not working properly, does not use the values from the config file, but falls back to env variables
What is the expected correct behavior?
-
glab config set
should update the corresponding values in the config file (~/.config/glab-cli/config.yml
) -
glab config get
should read the corresponding values from the config file and only fall back to env variables when they are unset as it is specified in the CLI help output, otherwise the configuration file is not very useful
Relevant logs and/or screenshots
➜ glab config get browser
/usr/bin/firefox
➜ grep ^browser: ~/.config/glab-cli/config.yml
browser: /usr/bin/vimb
➜ glab config set browser /usr/bin/chromium
➜ glab config get browser
/usr/bin/firefox
➜ grep ^browser: ~/.config/glab-cli/config.yml
browser: /usr/bin/vimb
➜ BROWSER=whatever glab config get browser
whatever
Possible fixes
Edited by Robert Mihaly