Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCP Config Not Detected on Windows #2814

Closed
1 task done
GavinOsborn opened this issue Sep 22, 2022 · 2 comments
Closed
1 task done

GCP Config Not Detected on Windows #2814

GavinOsborn opened this issue Sep 22, 2022 · 2 comments
Assignees
Labels
🐛 bug Something isn't working

Comments

@GavinOsborn
Copy link
Sponsor Contributor

Code of Conduct

  • I agree to follow this project's Code of Conduct

What happened?

The GCP segment does not appear to load config from the correct location on windows - I don't know about other platforms.

oh-my-posh debug tells me that it searches for config in C:\Users\OsbornG\.config\gcloud\active_config but...

When I install the GCloud SDK with next next next defaults following the instructions on the website the command gcloud info reports the following config location:

Installation Properties: [C:\Users\OsbornG\AppData\Local\Google\Cloud SDK\google-cloud-sdk\properties]
User Config Directory: [C:\Users\OsbornG\AppData\Roaming\gcloud]
Active Configuration Name: [default]
Active Configuration Path: [C:\Users\OsbornG\AppData\Roaming\gcloud\configurations\config_default]

This is my first time installing the GCloud CLI on Windows so I'm unsure if this is a change in behavior.

Theme

{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"newline": false,
"segments": [
{
"background": "blue",
"foreground": "yellow",
"type": "gcp",
"style": "powerline",
"powerline_symbol": "\ue0b4",
"template": "{{ if .Error }} {{ .Error }} {{ else }} {{ .Project }} {{ end }}"
}
],
"type": "prompt"
}
],
"version": 2
}

What OS are you seeing the problem on?

Windows

Which shell are you using?

bash, powershell

Log output

�[1mVersion:�[0m 9.5.0

�[1mSegments:�[0m

ConsoleTitle(false) -   1 ms - 
gcp(true)  -   1 ms - �[34;49m�[7m�[0m�[44m�[33m NO ACTIVE CONFIG FOUND �[0m

�[1mRun duration:�[0m 26.0328ms

�[1mCache path:�[0m C:\Users\OsbornG\AppData\Local\oh-my-posh

�[1mConfig path:�[0m C:/Users/OsbornG/code/gav/oh-my-posh-themes/gcp-repro.omp.json

�[1mLogs:�[0m

2022/09/22 11:34:00 debug: Getenv
C:\Users\OsbornG\AppData\Local
2022/09/22 11:34:00 Getenv duration: 0s, args: LOCALAPPDATA
2022/09/22 11:34:00 CachePath duration: 0s, args: 
2022/09/22 11:34:00 debug: Getenv
C:/Users/OsbornG/code/gav/oh-my-posh-themes/gcp-repro.omp.json
2022/09/22 11:34:00 Getenv duration: 0s, args: POSH_THEME
2022/09/22 11:34:00 debug: Shell
process name: bash.exe
2022/09/22 11:34:00 Shell duration: 16.0711ms, args: 
2022/09/22 11:34:00 resolveConfigPath duration: 16.0711ms, args: 
2022/09/22 11:34:00 Init duration: 23.3444ms, args: 
2022/09/22 11:34:00 Flags duration: 0s, args: 
2022/09/22 11:34:00 config.loadConfig duration: 569.3µs, args: 
2022/09/22 11:34:00 Flags duration: 0s, args: 
2022/09/22 11:34:00 debug: Getenv

2022/09/22 11:34:00 Getenv duration: 0s, args: OMP_CACHE_DISABLED
2022/09/22 11:34:00 WindowsRegistryKeyValue duration: 0s, args: HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorizationColor
2022/09/22 11:34:00 GOOS duration: 0s, args: 
2022/09/22 11:34:00 GOOS duration: 0s, args: 
2022/09/22 11:34:00 GOOS duration: 0s, args: 
2022/09/22 11:34:00 GOOS duration: 0s, args: 
2022/09/22 11:34:00 GOOS duration: 0s, args: 
2022/09/22 11:34:00 GOOS duration: 0s, args: 
2022/09/22 11:34:00 GOOS duration: 0s, args: 
2022/09/22 11:34:00 GOOS duration: 0s, args: 
2022/09/22 11:34:00 GOOS duration: 0s, args: 
2022/09/22 11:34:00 GOOS duration: 0s, args: 
2022/09/22 11:34:00 GOOS duration: 0s, args: 
2022/09/22 11:34:00 GOOS duration: 0s, args: 
2022/09/22 11:34:00 GOOS duration: 0s, args: 
2022/09/22 11:34:00 GOOS duration: 0s, args: 
2022/09/22 11:34:00 GOOS duration: 0s, args: 
2022/09/22 11:34:00 GOOS duration: 0s, args: 
2022/09/22 11:34:00 GOOS duration: 0s, args: 
2022/09/22 11:34:00 GOOS duration: 0s, args: 
2022/09/22 11:34:00 GOOS duration: 0s, args: 
2022/09/22 11:34:00 debug: WindowsRegistryKeyValue
ColorizationColor(DWORD): 0xC40078D7
2022/09/22 11:34:00 Root duration: 0s, args: 
2022/09/22 11:34:00 Shell duration: 0s, args: 
2022/09/22 11:34:00 ErrorCode duration: 0s, args: 
2022/09/22 11:34:00 IsWsl duration: 0s, args: 
2022/09/22 11:34:00 debug: Pwd
C:\Users\OsbornG
2022/09/22 11:34:00 Pwd duration: 0s, args: 
2022/09/22 11:34:00 debug: Home
C:\Users\OsbornG
2022/09/22 11:34:00 debug: Home
C:\Users\OsbornG
2022/09/22 11:34:00 GOOS duration: 0s, args: 
2022/09/22 11:34:00 GOOS duration: 0s, args: 
2022/09/22 11:34:00 GOOS duration: 0s, args: 
2022/09/22 11:34:00 GOOS duration: 0s, args: 
2022/09/22 11:34:00 GOOS duration: 0s, args: 
2022/09/22 11:34:00 GOOS duration: 0s, args: 
2022/09/22 11:34:00 GOOS duration: 0s, args: 
2022/09/22 11:34:00 GOOS duration: 0s, args: 
2022/09/22 11:34:00 GOOS duration: 0s, args: 
2022/09/22 11:34:00 debug: User
OsbornG
2022/09/22 11:34:00 User duration: 0s, args: 
2022/09/22 11:34:00 debug: Host
MEL-PF3NJR4W
2022/09/22 11:34:00 Host duration: 0s, args: 
2022/09/22 11:34:00 GOOS duration: 0s, args: 
2022/09/22 11:34:00 TemplateCache duration: 0s, args: 
2022/09/22 11:34:00 Flags duration: 0s, args: 
2022/09/22 11:34:00 debug: Pwd
C:\Users\OsbornG
2022/09/22 11:34:00 Pwd duration: 0s, args: 
2022/09/22 11:34:00 debug: Home
C:\Users\OsbornG
2022/09/22 11:34:00 GOOS duration: 0s, args: 
2022/09/22 11:34:00 debug: Getenv

2022/09/22 11:34:00 Getenv duration: 0s, args: CLOUDSDK_CONFIG
2022/09/22 11:34:00 debug: Home
C:\Users\OsbornG
2022/09/22 11:34:00 error: FileContent
open C:\Users\OsbornG\.config\gcloud\active_config: The system cannot find the path specified.
2022/09/22 11:34:00 FileContent duration: 549.5µs, args: C:\Users\OsbornG\.config\gcloud\active_config
2022/09/22 11:34:00 TemplateCache duration: 0s, args: 
2022/09/22 11:34:00 TemplateCache duration: 0s, args: 
2022/09/22 11:34:00 Shell duration: 0s, args: 
2022/09/22 11:34:00 debug: Getenv
C:\Users\OsbornG\AppData\Local
2022/09/22 11:34:00 Getenv duration: 0s, args: LOCALAPPDATA
2022/09/22 11:34:00 CachePath duration: 0s, args: 
2022/09/22 11:34:00 Flags duration: 0s, args:
@GavinOsborn GavinOsborn added the 🐛 bug Something isn't working label Sep 22, 2022
@JanDeDobbeleer
Copy link
Owner

@GavinOsborn this is possibly right. The segment was created by a contributor and probably only used a unix environment. I'll adjust.

JanDeDobbeleer added a commit that referenced this issue Sep 23, 2022
Copy link

This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues.
If you have found a problem that seems similar, please open a discussion first, complete the body with all the details necessary to reproduce, and mention this issue as reference.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants