Closed mrala closed 4 months ago
If an app has an invisible U+200E character, it will not match the app name defined in app-icons.js.
app-icons.js
❯ queryTitle=$(yabai -m query --windows --space 1 | jq '.[].app') ❯ echo $queryTitle "WhatsApp" # get the ASCII value of the unicode character ❯ echo $queryTitle | hexdump -C 00000000 22 e2 80 8e 57 68 61 74 73 41 70 70 22 0a |"...WhatsApp".| 0000000e # compare to expected string without unicode character ❯ echo \"WhatsApp\" | hexdump -C 00000000 22 57 68 61 74 73 41 70 70 22 0a |"WhatsApp".| 0000000b ❯ echo $queryTitle "WhatsApp" # get number of bytes with string that contains hidden unicode character ❯ echo $queryTitle | wc -c 14 # remove UTF-8 hex (e2 80 8e) ❯ echo $queryTitle | sed "s/\xe2\x80\x8e//g" | wc -c 11 # compare number of bytes to string without unicode character ❯ echo \"WhatsApp\" | wc -c 11 # does not affect other unicode characters, test with Chinese name for Finder ❯ echo $'\U8BBF'$'\U8FBE' 访达 ❯ echo $'\U8BBF'$'\U8FBE' | wc -c 7 ❯ echo $'\U8BBF'$'\U8FBE' | sed "s/\xe2\x80\x8e//g" 访达 ❯ echo $'\U8BBF'$'\U8FBE' | sed "s/\xe2\x80\x8e//g" | wc -c 7
n/a
Thank you for that! I appreciate your contributions :)
Description
If an app has an invisible U+200E character, it will not match the app name defined in
app-icons.js
.Type of change
How Has This Been Tested?
Checklist:
Changes to make to the documentation
n/a