Sign in or sign up before continuing. Don't have an account yet? Register now to get started.
`glab config get user --host` returns OS `$USER` instead of host config value
### Checklist
- [x] I'm using the latest version of the extension (Run `glab --version`)
- Extension version: glab 1.90.0 (19936043)
- [x] Operating system and version: macOS
- [x] Gitlab.com or self-managed instance? self-managed
- [x] I have performed `glab auth status` to check for authentication issues
- [x] Run the command in debug mode
### Summary
`glab config get user --host <host>` returns the OS `$USER` environment variable instead of the `user` value from the host config.
### Environment
- OS: macOS (darwin arm64)
- SHELL: bash
- GLAB: glab 1.90.0 (19936043)
### Steps to reproduce
1. Have a host with `user` configured:
```yaml
hosts:
gitlab.example.com:
user: Foo.Bar
```
2. Run `glab config get user --host gitlab.example.com`
### What is the current _bug_ behavior?
Returns OS `$USER` (e.g. `christian`).
### What is the expected _correct_ behavior?
Returns `Foo.Bar` from the host config.
### Possible fixes
In `internal/config/config_mapping.go`, `EnvKeyEquivalence` has no explicit mapping for `user`, so the `default` case returns `[]string{strings.ToUpper(key)}` which resolves to `$USER`. Since `GetWithSource` checks env vars before host config, `$USER` (always set on Unix) shadows the config value.
Fix: add `user` to the explicit key mappings, or more broadly, don't fall through to `$KEY` for keys that are only meaningful as host-specific config.
issue