Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid unicode characters for VPN #437

Closed
kurczynski opened this issue Aug 29, 2024 · 2 comments
Closed

Invalid unicode characters for VPN #437

kurczynski opened this issue Aug 29, 2024 · 2 comments

Comments

@kurczynski
Copy link

kurczynski commented Aug 29, 2024

In segments/vpn.sh, invalid Unicode characters are used for the following env vars:

  • TMUX_POWERLINE_SEG_VPN_SYMBOL="󱠾 "
  • TMUX_POWERLINE_SEG_VPN_DISPLAY_SEPARATOR="󰿟"

Apparently the value for TMUX_POWERLINE_SEG_VPN_SYMBOL is U+F183E and TMUX_POWERLINE_SEG_VPN_DISPLAY_SEPARATOR is U+F0FDF which both live in the Unicode "SUPPLEMENTARY_PRIVATE_USE_AREA_A".

It seems that #383 added this VPN functionality and the screenshot in that issue shows properly rendered characters, but I'm assuming that's because they have some additional font pack installed.

I suggest setting the affected environment variables to the following:

  • TMUX_POWERLINE_SEG_VPN_SYMBOL="🔒"
  • TMUX_POWERLINE_SEG_VPN_DISPLAY_SEPARATOR="/"

If sounds reasonable, I can create a PR with the changes.

@xx4h
Copy link
Collaborator

xx4h commented Aug 30, 2024

Hi there,

Actually they are supposed to be like that. tmux-powerline always required you to install so called patched fonts.

At the beginning powerline fonts were required, but for some time now, we're using Nerd Fonts.

This is also part of the requirements list in the README.md Requirements Section:

tmux-powerline/README.md

Lines 91 to 95 in 717688b

Requirements for the lib to work are:
* `tmux -V` >= 2.1
* `bash --version` >= 3.2 (Does not have to be your default shell.)
* Nerd Font. Follow instructions at [Font Installation](https://github.com/ryanoasis/nerd-fonts?tab=readme-ov-file#font-installation). However you can use other substitute symbols as well; see `config.sh`.

You can use fc-list to find supported fonts for certain charsets already installed on your system, for some more information regarding this, you can checkout this discussion

Override

For some segments you can override things like symbols and separators, e.g. if you are happy with the overall appearance of your tmux-powerline and don't want to change the font right now. In your case (for segments/vpn.sh) you have the following options:

# Mode for VPN segment {"both", "ip", "name"}. both: Show NIC/IP; ip: Show only IP; name: Show only NIC name
# export TMUX_POWERLINE_SEG_VPN_DISPLAY_MODE="${TMUX_POWERLINE_SEG_VPN_DISPLAY_MODE}"
# Space separated list of tunnel interface names. First match is being used. substring match, regexp can be used.
# Examples:
# export TMUX_POWERLINE_SEG_VPN_NICS="tun" # will match 'tun0', 'utun0', 'itun', 'tun08127387'
# export TMUX_POWERLINE_SEG_VPN_NICS="tun0 tuntun" # will match 'tun0', 'utun0', 'tuntun'
# export TMUX_POWERLINE_SEG_VPN_NICS="^tun0$ ^tun1$" # exactly 'tun0' and 'tun1'
# Default:
# export TMUX_POWERLINE_SEG_VPN_NICS='${TMUX_POWERLINE_SEG_VPN_NICS}'
# Symbol to use for vpn tunnel.
# export TMUX_POWERLINE_SEG_VPN_SYMBOL="${TMUX_POWERLINE_SEG_VPN_SYMBOL}"
# Colour for vpn tunnel symbol
# export TMUX_POWERLINE_SEG_VPN_SYMBOL_COLOUR="${TMUX_POWERLINE_SEG_VPN_SYMBOL_COLOUR}"
# Symbol for separator
# export TMUX_POWERLINE_SEG_VPN_DISPLAY_SEPARATOR="${TMUX_POWERLINE_SEG_VPN_DISPLAY_SEPARATOR}"

which you should also find in your ~/.config/tmux-powerline/config.sh.default (details on how to (re-)generate the default file are available in the README.md Config-File Section)

@xx4h xx4h closed this as completed Aug 30, 2024
@kurczynski
Copy link
Author

Ah, that makes sense then. I had just assumed that more would have been broken if I didn't have the fonts installed. Thanks for the help and information!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants