dracula / tmux

🧛🏻‍♂️ Dark theme for tmux
https://draculatheme.com/tmux
MIT License
660 stars 312 forks source link

Update network.sh to not cut off SSIDs starting with `^` #237

Closed djfpaagman closed 1 year ago

djfpaagman commented 1 year ago

My SSID is ^_^. I noticed that gets cutt of to _^ in the status bar.

I think the original regex (introduced here: https://github.com/dracula/tmux/pull/39) is just wrong, maybe the "start of line" indicator is in the wrong place? Anyway, this new regex will fix that.

The plain SSID without the regex replacement:

❯ echo "$(/System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -I | grep -E ' SSID' | cut -d ':' -f 2)"
 ^_^

(note the extra space it's supposed to remove)

Before:

❯ echo "$(/System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -I | grep -E ' SSID' | cut -d ':' -f 2)" | sed 's/ ^*//g'
_^

After:

❯ echo "$(/System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport -I | grep -E ' SSID' | cut -d ':' -f 2)" | sed 's/^[[:blank:]]*//g'
^_^

sed 's/^ *//g' will also work, but I like the explicitness of [[:blank:]].

ethancedwards8 commented 1 year ago

Heh that's amusing, thanks for the fix.