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

.OS environmental variable no longer provides linux distributions #1639

Closed
1 task done
RustyBrakes opened this issue Jan 24, 2022 · 4 comments · Fixed by #1671
Closed
1 task done

.OS environmental variable no longer provides linux distributions #1639

RustyBrakes opened this issue Jan 24, 2022 · 4 comments · Fixed by #1671
Assignees
Labels
🐛 bug Something isn't working

Comments

@RustyBrakes
Copy link

Code of Conduct

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

What happened?

Between 6.51.0 and 7.5.1 (sorry I can't be more specific) I have found that .OS variable gives "linux" as result instead of debian/ubuntu/etc .

This has happened both on WSL and native Linux install (and both previously provided distro name instead)

Theme

Chameleon: https://github.com/RustyBrakes/omp-theme

I have tried putting the "{{ if eq .OS \"linux\" }}p:linux3{{ end }}", at the end of the logic chain and the same result happens.

What OS are you seeing the problem on?

Linux

Which shell are you using?

bash

Log output

Version: 7.5.1

Segments:

ConsoleTitle(false)  -   0 ms -
os(true)             -   0 ms - wsl: ubuntu 
session(false)       -   0 ms -
shell(true)          -   0 ms - uni
az(false)            -   0 ms -
time(true)           -   0 ms - 11:29AM
path(true)           -   1 ms - ~/.poshthemes
text(true)           -   0 ms -  $
executiontime(false) -   0 ms -
git(true)            -   0 ms -   main
battery(false)       -   0 ms -

Run duration: 13.608458ms

Cache path: /home/george/.cache/oh-my-posh

Logs:

2022/01/24 11:29:28 getArgs duration: 130ns, args:
2022/01/24 11:29:28 getArgs duration: 40ns, args:
2022/01/24 11:29:28 getShellName duration: 470ns, args:
2022/01/24 11:29:28 debug: getenv

2022/01/24 11:29:28 getenv duration: 6.99µs, args: OMP_CACHE_DISABLED
2022/01/24 11:29:28 isRunningAsRoot duration: 470ns, args:
2022/01/24 11:29:28 getShellName duration: 100ns, args:
2022/01/24 11:29:28 lastErrorCode duration: 70ns, args:
2022/01/24 11:29:28 debug: pwd
/home/george/.poshthemes
2022/01/24 11:29:28 pwd duration: 18.031µs, args:
2022/01/24 11:29:28 getPathSeperator duration: 60ns, args:
2022/01/24 11:29:28 getPathSeperator duration: 30ns, args:
2022/01/24 11:29:28 getPathSeperator duration: 40ns, args:
2022/01/24 11:29:28 getPathSeperator duration: 40ns, args:
2022/01/24 11:29:28 getPathSeperator duration: 30ns, args:
2022/01/24 11:29:28 getPathSeperator duration: 30ns, args:
2022/01/24 11:29:28 getPathSeperator duration: 40ns, args:
2022/01/24 11:29:28 getPathSeperator duration: 40ns, args:
2022/01/24 11:29:28 getPathSeperator duration: 40ns, args:
2022/01/24 11:29:28 getPathSeperator duration: 40ns, args:
2022/01/24 11:29:28 getPathSeperator duration: 40ns, args:
2022/01/24 11:29:28 getPathSeperator duration: 40ns, args:
2022/01/24 11:29:28 getPathSeperator duration: 40ns, args:
2022/01/24 11:29:28 getCurrentUser duration: 210ns, args:
2022/01/24 11:29:28 getHostName duration: 1.37µs, args:
2022/01/24 11:29:28 getRuntimeGOOS duration: 50ns, args:
2022/01/24 11:29:28 templateCache duration: 59.361µs, args:
2022/01/24 11:29:28 debug: pwd
/home/george/.poshthemes
2022/01/24 11:29:28 pwd duration: 1.06µs, args:
2022/01/24 11:29:28 getRuntimeGOOS duration: 40ns, args:
2022/01/24 11:29:28 debug: getenv
Ubuntu
2022/01/24 11:29:28 getenv duration: 1.02µs, args: WSL_DISTRO_NAME
2022/01/24 11:29:28 isWsl duration: 3.51µs, args:
2022/01/24 11:29:28 templateCache duration: 150ns, args:
2022/01/24 11:29:28 templateCache duration: 150ns, args:
2022/01/24 11:29:28 templateCache duration: 170ns, args:
2022/01/24 11:29:28 templateCache duration: 160ns, args:
2022/01/24 11:29:28 templateCache duration: 170ns, args:
2022/01/24 11:29:28 templateCache duration: 160ns, args:
2022/01/24 11:29:28 templateCache duration: 260ns, args:
2022/01/24 11:29:28 debug: pwd
/home/george/.poshthemes
2022/01/24 11:29:28 pwd duration: 3.55µs, args:
2022/01/24 11:29:28 debug: getenv

2022/01/24 11:29:28 getenv duration: 1.24µs, args: SSH_CONNECTION
2022/01/24 11:29:28 debug: getenv

2022/01/24 11:29:28 getenv duration: 940ns, args: SSH_CLIENT
2022/01/24 11:29:28 templateCache duration: 210ns, args:
2022/01/24 11:29:28 debug: pwd
/home/george/.poshthemes
2022/01/24 11:29:28 pwd duration: 1.14µs, args:
2022/01/24 11:29:28 getShellName duration: 90ns, args:
2022/01/24 11:29:28 templateCache duration: 190ns, args:
2022/01/24 11:29:28 templateCache duration: 150ns, args:
2022/01/24 11:29:28 templateCache duration: 180ns, args:
2022/01/24 11:29:28 templateCache duration: 200ns, args:
2022/01/24 11:29:28 templateCache duration: 170ns, args:
2022/01/24 11:29:28 templateCache duration: 190ns, args:
2022/01/24 11:29:28 debug: pwd
/home/george/.poshthemes
2022/01/24 11:29:28 pwd duration: 2.18µs, args:
2022/01/24 11:29:28 error: getFileContent
open /home/george/.azure/azureProfile.json: no such file or directory
2022/01/24 11:29:28 getFileContent duration: 50.59µs, args: /home/george/.azure/azureProfile.json
2022/01/24 11:29:28 error: getFileContent
open /home/george/.azure/AzureRmContext.json: no such file or directory
2022/01/24 11:29:28 getFileContent duration: 3.97µs, args: /home/george/.azure/AzureRmContext.json
2022/01/24 11:29:28 error: getFileContent
open /home/george/.Azure/AzureRmContext.json: no such file or directory
2022/01/24 11:29:28 getFileContent duration: 2.54µs, args: /home/george/.Azure/AzureRmContext.json
2022/01/24 11:29:28 debug: pwd
/home/george/.poshthemes
2022/01/24 11:29:28 pwd duration: 1.09µs, args:
2022/01/24 11:29:28 templateCache duration: 200ns, args:
2022/01/24 11:29:28 templateCache duration: 180ns, args:
2022/01/24 11:29:28 templateCache duration: 180ns, args:
2022/01/24 11:29:28 templateCache duration: 190ns, args:
2022/01/24 11:29:28 templateCache duration: 150ns, args:
2022/01/24 11:29:28 templateCache duration: 60ns, args:
2022/01/24 11:29:28 templateCache duration: 190ns, args:
2022/01/24 11:29:28 debug: pwd
/home/george/.poshthemes
2022/01/24 11:29:28 pwd duration: 1.47µs, args:
2022/01/24 11:29:28 debug: pwd
/home/george/.poshthemes
2022/01/24 11:29:28 pwd duration: 900ns, args:
2022/01/24 11:29:28 getArgs duration: 60ns, args:
2022/01/24 11:29:28 debug: pwd
/home/george/.poshthemes
2022/01/24 11:29:28 pwd duration: 800ns, args:
2022/01/24 11:29:28 getRuntimeGOOS duration: 50ns, args:
2022/01/24 11:29:28 getRuntimeGOOS duration: 50ns, args:
2022/01/24 11:29:28 getPathSeperator duration: 90ns, args:
2022/01/24 11:29:28 getArgs duration: 40ns, args:
2022/01/24 11:29:28 debug: pwd
/home/george/.poshthemes
2022/01/24 11:29:28 pwd duration: 800ns, args:
2022/01/24 11:29:28 getRuntimeGOOS duration: 40ns, args:
2022/01/24 11:29:28 getRuntimeGOOS duration: 40ns, args:
2022/01/24 11:29:28 getPathSeperator duration: 30ns, args:
2022/01/24 11:29:28 getPathSeperator duration: 40ns, args:
2022/01/24 11:29:28 getRuntimeGOOS duration: 30ns, args:
2022/01/24 11:29:28 debug: getenv
Ubuntu
2022/01/24 11:29:28 getenv duration: 1.14µs, args: WSL_DISTRO_NAME
2022/01/24 11:29:28 isWsl duration: 3.31µs, args:
2022/01/24 11:29:28 debug: runCommand
//wsl.localhost/Ubuntu/home/george/.poshthemes
2022/01/24 11:29:28 runCommand duration: 1.582853ms, args: wslpath -m /home/george/.poshthemes
2022/01/24 11:29:28 stackCount duration: 270ns, args:
2022/01/24 11:29:28 templateCache duration: 140ns, args:
2022/01/24 11:29:28 templateCache duration: 220ns, args:
2022/01/24 11:29:28 templateCache duration: 150ns, args:
2022/01/24 11:29:28 templateCache duration: 210ns, args:
2022/01/24 11:29:28 templateCache duration: 160ns, args:
2022/01/24 11:29:28 templateCache duration: 170ns, args:
2022/01/24 11:29:28 templateCache duration: 170ns, args:
2022/01/24 11:29:28 templateCache duration: 250ns, args:
2022/01/24 11:29:28 debug: pwd
/home/george/.poshthemes
2022/01/24 11:29:28 pwd duration: 2.01µs, args:
2022/01/24 11:29:28 templateCache duration: 160ns, args:
2022/01/24 11:29:28 templateCache duration: 190ns, args:
2022/01/24 11:29:28 templateCache duration: 200ns, args:
2022/01/24 11:29:28 templateCache duration: 260ns, args:
2022/01/24 11:29:28 templateCache duration: 510ns, args:
2022/01/24 11:29:28 templateCache duration: 190ns, args:
2022/01/24 11:29:28 templateCache duration: 200ns, args:
2022/01/24 11:29:28 debug: pwd
/home/george/.poshthemes
2022/01/24 11:29:28 pwd duration: 1.8µs, args:
2022/01/24 11:29:28 executionTime duration: 190ns, args:
2022/01/24 11:29:28 debug: pwd
/home/george/.poshthemes
2022/01/24 11:29:28 pwd duration: 1.49µs, args:
2022/01/24 11:29:28 debug: getenv
Ubuntu
2022/01/24 11:29:28 getenv duration: 1.45µs, args: WSL_DISTRO_NAME
2022/01/24 11:29:28 isWsl duration: 4.26µs, args:
2022/01/24 11:29:28 debug: pwd
/home/george/.poshthemes
2022/01/24 11:29:28 pwd duration: 1.19µs, args:
2022/01/24 11:29:28 getRuntimeGOOS duration: 70ns, args:
2022/01/24 11:29:28 hasCommand duration: 69.87µs, args: git
2022/01/24 11:29:28 debug: pwd
/home/george/.poshthemes
2022/01/24 11:29:28 pwd duration: 1.06µs, args:
2022/01/24 11:29:28 hasParentFilePath duration: 6.97µs, args: .git
2022/01/24 11:29:28 getFileContent duration: 19.81µs, args: /home/george/.poshthemes/.git/HEAD
2022/01/24 11:29:28 debug: pwd
/home/george/.poshthemes
2022/01/24 11:29:28 pwd duration: 1.12µs, args:
2022/01/24 11:29:28 getBatteryInfo duration: 27.58µs, args:
2022/01/24 11:29:28 debug: getenv

2022/01/24 11:29:28 getenv duration: 1.45µs, args: XDG_CACHE_HOME
2022/01/24 11:29:28 getCachePath duration: 8.87µs, args:
@RustyBrakes RustyBrakes added the 🐛 bug Something isn't working label Jan 24, 2022
@RustyBrakes
Copy link
Author

I understand I am not the only use case - perhaps there is need for an .OS variable and a .Distro variable? Or some other kind of solution that allows both to be possible?

@JanDeDobbeleer
Copy link
Owner

@RustyBrakes I'll fix that. Should be the way you describe it.

JanDeDobbeleer added a commit that referenced this issue Feb 3, 2022
JanDeDobbeleer added a commit that referenced this issue Feb 3, 2022
@RustyBrakes
Copy link
Author

Confirming that it's all fixed on my end!

Copy link

github-actions bot commented Mar 4, 2024

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 Mar 4, 2024
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

Successfully merging a pull request may close this issue.

2 participants