Jean-Tinland / simple-bar

A yabai status bar widget for Übersicht
https://www.jeantinland.com/toolbox/simple-bar
MIT License
1.19k stars 130 forks source link

Fix newlines in yabai output #402

Closed ZhongXiLu closed 4 months ago

ZhongXiLu commented 4 months ago

Description

Whenever I cmd + f in my Google Chrome to search the web page, the parsing of the yabai windows output fails due to a newline in the output. Google Chrome will prefix the window title with "Find in page\n":

{
  "title": "Find in page\n    Amazon Web Services Sign-In"
}

I'm not sure since when this was broken, possibly since f165275d1c87fed45129b99da0163459b6f87f0f, but reverting this commit still did not fix this issue. I got it fixed by adding the | tr -d '\n' at the end instead.

Type of change

How Has This Been Tested?

I manually tested this.

Before my commit, it would show "... JSON error..." in the bar if I would cmd + f on a page. After my commit, it works normally.

Test Configuration:

Checklist:

Jean-Tinland commented 4 months ago

Oh, sorry I must have broken your fix by simplifying the new line cleanup thinking it would still work.