oh-my-posh: Spotify segment not working
Code of Conduct
- I agree to follow this project’s Code of Conduct
What happened?
I’m trying to make Spotify segment to work. But nothing happens! It seems to load well, but a matching Window Title is not found. Spotify version: Spotify for Windows 1.1.81.604.gccacfc8c (Installed from Web, not Store (already tried with the Store version))
I made two scripts to get all process windows titles. One using C# and the other using Powershell itself.
These are the string I got from the logs:
C# version (Id, Name and MainWindowTitle, respectively):
| Process Spotify | ID: 14620 | Window Title: Demon Hunter - Collapsing (feat. Björn "Speed" Strid)
Powershell version (Id, Name and MainWindowTitle, respectively):
14620 Spotify Demon Hunter - Collapsing (feat. Björn "Speed" Strid)
Theme
What OS are you seeing the problem on?
Windows
Which shell are you using?
powershell
Log output
oh-my-posh debug log:
Segments:
spotify(false) - 57 ms -
Logs:
2022/04/04 14:56:12 error: QueryWindowTitles
no matching window title found
2022/04/04 14:56:12 WindowTitle duration: 30.0003ms, args: ^(Spotify.*)|(.*\s-\s.*)$
2022/04/04 14:56:12 error: QueryWindowTitles
no matching window title found
2022/04/04 14:56:12 WindowTitle duration: 27.9637ms, args: ^(Spotify.*)
2022/04/04 14:56:12 debug: Pwd
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 18 (9 by maintainers)
Commits related to this issue
- fix(spotify): check error presence before handling relates to #2031 — committed to JanDeDobbeleer/oh-my-posh by JanDeDobbeleer 2 years ago
- fix(spotify): check error presence before handling relates to #2031 — committed to JanDeDobbeleer/oh-my-posh by JanDeDobbeleer 2 years ago
- fix(spotify): ignore errors resolves #2031 — committed to JanDeDobbeleer/oh-my-posh by JanDeDobbeleer 2 years ago
- fix(spotify): ignore errors resolves #2031 — committed to JanDeDobbeleer/oh-my-posh by JanDeDobbeleer 2 years ago
@marechal-dev @INblau-LucaGerhardt fix incoming
@JanDeDobbeleer OH YEAH BABY

Yup, there’s no error message. Grasping for straws here as this is deep into the win32 API. @marechal-dev OK if I provide a custom build so we can see a crazy amount of logging? Wouldn’t want that for everyone 😃
@marechal-dev my man. That’s the issue. That error is localized 😂
@JanDeDobbeleer For me the spotify segment is working. But when Spotify is not running, I get following error output (on Windows, WSL is working fine):
@marechal-dev the regex matches, so the title isn’t the issue here. I have no idea what just yet.