JanDeDobbeleer / oh-my-posh

The most customisable and low-latency cross platform/shell prompt renderer
https://ohmyposh.dev
MIT License
16.79k stars 2.35k forks source link

Wrong PhysicalPercentUsed percentage #2332

Closed jayagami closed 2 years ago

jayagami commented 2 years ago

Code of Conduct

What happened?

A bug happened! image

show wrong PhysicalPercentUsed percentage,

seems related to https://github.com/JanDeDobbeleer/oh-my-posh/issues/1786#issue-1144738795

could be a upstream problem.

Theme

clean-detailed, 1_shell

What OS are you seeing the problem on?

Windows

Which shell are you using?

powershell

Log output

Run duration: 111.1341ms

Cache path: C:\Users\uchiha\AppData\Local\oh-my-posh

Config path: C:\Users\uchiha\scoop\apps\oh-my-posh\current\themes\clean-detailed.omp.json

Logs:

2022/05/26 12:06:38 debug: Getenv
C:\Users\uchiha\AppData\Local
2022/05/26 12:06:38 Getenv duration: 0s, args: LOCALAPPDATA
2022/05/26 12:06:38 CachePath duration: 2.4943ms, args:
2022/05/26 12:06:38 debug: Getenv
C:\Users\uchiha\scoop\apps\oh-my-posh\current\themes\clean-detailed.omp.json
2022/05/26 12:06:38 Getenv duration: 0s, args: POSH_THEME
2022/05/26 12:06:38 Shell duration: 17.1424ms, args:
2022/05/26 12:06:38 resolveConfigPath duration: 17.1424ms, args:
2022/05/26 12:06:38 Init duration: 19.6367ms, args:
2022/05/26 12:06:38 Flags duration: 0s, args:
2022/05/26 12:06:38 config.loadConfig duration: 539.1µs, args:
2022/05/26 12:06:38 Flags duration: 0s, args:
2022/05/26 12:06:38 debug: Getenv

2022/05/26 12:06:38 Getenv duration: 0s, args: OMP_CACHE_DISABLED
2022/05/26 12:06:38 Root duration: 0s, args:
2022/05/26 12:06:38 Shell duration: 0s, args:
2022/05/26 12:06:38 ErrorCode duration: 0s, args:
2022/05/26 12:06:38 IsWsl duration: 0s, args:
2022/05/26 12:06:38 debug: Pwd
C:\Users\uchiha
2022/05/26 12:06:38 Pwd duration: 0s, args:
2022/05/26 12:06:38 debug: Home
C:\Users\uchiha
2022/05/26 12:06:38 PathSeparator duration: 0s, args:
2022/05/26 12:06:38 PathSeparator duration: 0s, args:
2022/05/26 12:06:38 debug: User
uchiha
2022/05/26 12:06:38 User duration: 0s, args:
2022/05/26 12:06:38 debug: Host
SEELE
2022/05/26 12:06:38 Host duration: 0s, args:
2022/05/26 12:06:38 GOOS duration: 0s, args:
2022/05/26 12:06:38 TemplateCache duration: 0s, args:
2022/05/26 12:06:38 Flags duration: 0s, args:
2022/05/26 12:06:38 debug: Pwd
C:\Users\uchiha
2022/05/26 12:06:38 Pwd duration: 0s, args:
2022/05/26 12:06:38 debug: Home
C:\Users\uchiha
2022/05/26 12:06:38 GOOS duration: 0s, args:
2022/05/26 12:06:38 GOOS duration: 0s, args:
2022/05/26 12:06:38 TemplateCache duration: 0s, args:
2022/05/26 12:06:38 TemplateCache duration: 0s, args:
2022/05/26 12:06:38 Shell duration: 0s, args:
2022/05/26 12:06:38 debug: Pwd
C:\Users\uchiha
2022/05/26 12:06:38 Pwd duration: 0s, args:
2022/05/26 12:06:38 debug: Home
C:\Users\uchiha
2022/05/26 12:06:38 GOOS duration: 0s, args:
2022/05/26 12:06:38 Shell duration: 0s, args:
2022/05/26 12:06:38 Flags duration: 0s, args:
2022/05/26 12:06:38 TemplateCache duration: 0s, args:
2022/05/26 12:06:38 TemplateCache duration: 0s, args:
2022/05/26 12:06:38 Shell duration: 0s, args:
2022/05/26 12:06:38 debug: Pwd
C:\Users\uchiha
2022/05/26 12:06:38 Pwd duration: 0s, args:
2022/05/26 12:06:38 debug: Home
C:\Users\uchiha
2022/05/26 12:06:38 GOOS duration: 0s, args:
2022/05/26 12:06:38 TemplateCache duration: 0s, args:
2022/05/26 12:06:38 TemplateCache duration: 0s, args:
2022/05/26 12:06:38 Shell duration: 0s, args:
2022/05/26 12:06:38 debug: Pwd
C:\Users\uchiha
2022/05/26 12:06:38 Pwd duration: 0s, args:
2022/05/26 12:06:38 debug: Home
C:\Users\uchiha
2022/05/26 12:06:38 GOOS duration: 0s, args:
2022/05/26 12:06:38 TemplateCache duration: 0s, args:
2022/05/26 12:06:38 TemplateCache duration: 0s, args:
2022/05/26 12:06:38 Shell duration: 0s, args:
2022/05/26 12:06:38 debug: Pwd
C:\Users\uchiha
2022/05/26 12:06:38 Pwd duration: 0s, args:
2022/05/26 12:06:38 debug: Home
C:\Users\uchiha
2022/05/26 12:06:38 GOOS duration: 0s, args:
2022/05/26 12:06:38 ExecutionTime duration: 0s, args:
2022/05/26 12:06:38 TemplateCache duration: 0s, args:
2022/05/26 12:06:38 TemplateCache duration: 0s, args:
2022/05/26 12:06:38 Shell duration: 0s, args:
2022/05/26 12:06:38 Flags duration: 0s, args:
2022/05/26 12:06:38 debug: Pwd
C:\Users\uchiha
2022/05/26 12:06:38 Pwd duration: 0s, args:
2022/05/26 12:06:38 debug: Home
C:\Users\uchiha
2022/05/26 12:06:38 GOOS duration: 0s, args:
2022/05/26 12:06:38 GOOS duration: 0s, args:
2022/05/26 12:06:38 HasCommand duration: 17.5125ms, args: git.exe
2022/05/26 12:06:38 debug: Pwd
C:\Users\uchiha
2022/05/26 12:06:38 Pwd duration: 0s, args:
2022/05/26 12:06:38 error: HasParentFilePath
CreateFile C:\.git: The system cannot find the file specified.
2022/05/26 12:06:38 HasParentFilePath duration: 0s, args: .git
2022/05/26 12:06:38 Flags duration: 0s, args:
2022/05/26 12:06:38 debug: Pwd
C:\Users\uchiha
2022/05/26 12:06:38 Pwd duration: 0s, args:
2022/05/26 12:06:38 debug: Home
C:\Users\uchiha
2022/05/26 12:06:38 GOOS duration: 0s, args:
2022/05/26 12:06:38 TemplateCache duration: 0s, args:
2022/05/26 12:06:38 TemplateCache duration: 0s, args:
2022/05/26 12:06:38 Shell duration: 0s, args:
2022/05/26 12:06:38 debug: Pwd
C:\Users\uchiha
2022/05/26 12:06:38 Pwd duration: 0s, args:
2022/05/26 12:06:38 debug: Home
C:\Users\uchiha
2022/05/26 12:06:38 GOOS duration: 0s, args:
2022/05/26 12:06:38 TemplateCache duration: 0s, args:
2022/05/26 12:06:38 TemplateCache duration: 0s, args:
2022/05/26 12:06:38 Shell duration: 0s, args:
2022/05/26 12:06:38 debug: Pwd
C:\Users\uchiha
2022/05/26 12:06:38 Pwd duration: 0s, args:
2022/05/26 12:06:38 debug: Home
C:\Users\uchiha
2022/05/26 12:06:38 GOOS duration: 0s, args:
2022/05/26 12:06:38 Root duration: 0s, args:
2022/05/26 12:06:38 debug: Pwd
C:\Users\uchiha
2022/05/26 12:06:38 Pwd duration: 0s, args:
2022/05/26 12:06:38 debug: Home
C:\Users\uchiha
2022/05/26 12:06:38 GOOS duration: 0s, args:
2022/05/26 12:06:38 debug: Pwd
C:\Users\uchiha
2022/05/26 12:06:38 Pwd duration: 0s, args:
2022/05/26 12:06:38 Flags duration: 0s, args:
2022/05/26 12:06:38 debug: Pwd
C:\Users\uchiha
2022/05/26 12:06:38 Pwd duration: 0s, args:
2022/05/26 12:06:38 debug: Home
C:\Users\uchiha
2022/05/26 12:06:38 GOOS duration: 0s, args:
2022/05/26 12:06:38 GOOS duration: 0s, args:
2022/05/26 12:06:38 Flags duration: 0s, args:
2022/05/26 12:06:38 debug: Pwd
C:\Users\uchiha
2022/05/26 12:06:38 Pwd duration: 0s, args:
2022/05/26 12:06:38 debug: Home
C:\Users\uchiha
2022/05/26 12:06:38 GOOS duration: 0s, args:
2022/05/26 12:06:38 GOOS duration: 0s, args:
2022/05/26 12:06:38 PathSeparator duration: 0s, args:
2022/05/26 12:06:38 PathSeparator duration: 0s, args:
2022/05/26 12:06:38 PathSeparator duration: 0s, args:
2022/05/26 12:06:38 PathSeparator duration: 0s, args:
2022/05/26 12:06:38 GOOS duration: 0s, args:
2022/05/26 12:06:38 IsWsl duration: 0s, args:
2022/05/26 12:06:38 StackCount duration: 0s, args:
2022/05/26 12:06:38 error: DirIsWritable
Write permission bit is not set on this file for user
2022/05/26 12:06:38 DirIsWritable duration: 0s, args:
2022/05/26 12:06:38 TemplateCache duration: 0s, args:
2022/05/26 12:06:38 TemplateCache duration: 0s, args:
2022/05/26 12:06:38 Shell duration: 0s, args:
2022/05/26 12:06:38 Flags duration: 0s, args:
2022/05/26 12:06:38 debug: Pwd
C:\Users\uchiha
2022/05/26 12:06:38 Pwd duration: 0s, args:
2022/05/26 12:06:38 debug: Home
C:\Users\uchiha
2022/05/26 12:06:38 GOOS duration: 0s, args:
2022/05/26 12:06:38 ErrorCode duration: 0s, args:
2022/05/26 12:06:38 TemplateCache duration: 0s, args:
2022/05/26 12:06:38 TemplateCache duration: 0s, args:
2022/05/26 12:06:38 Shell duration: 0s, args:
2022/05/26 12:06:38 debug: Getenv
C:\Users\uchiha\AppData\Local
2022/05/26 12:06:38 Getenv duration: 0s, args: LOCALAPPDATA
2022/05/26 12:06:38 CachePath duration: 0s, args:
2022/05/26 12:06:38 Flags duration: 0s, args:
JanDeDobbeleer commented 2 years ago

@jayagami this is actually correct as you're using .PhysicalPercentUsed which is the percentage of physical memory in use and not an indication of CPU load. CPU load is currently not yet exposed.

gregkonush commented 1 year ago

There are variables available Load1, Load5, and Load15. You can use that to swap in theme JSON file like so:

"template": "\uf85a CPU: {{ round .Load1 .Precision }}% | ",

image

gork3n commented 1 year ago

Themes that are packaged with the oh-my-posh install use the memory percentage as the CPU stat. Anyway in clean-detailed.omp.json I changed CPU: to MEM: moved "trailing_diamond": "<transparent,#516BEB\ue0b2</>", from MEM: block to the CPU: block and deleted the whole MEM: block.

JanDeDobbeleer commented 1 year ago

@gork3n mind doing a PR for this?

Jhonmcr commented 10 months ago

Hola amigos una pregunta, que plugin usan para que la terminal se vea con ese estilo?

JanDeDobbeleer commented 10 months ago

Hello friends, a question, what plugin do you use to make the terminal look like that?

@Jhonmcr you find yourself in the oh-my-posh repository, so there's your answer 😅

github-actions[bot] commented 4 months ago

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.