diff options
author | Jonathan Sambrook <jonathan.sambrook@codethink.co.uk> | 2022-11-14 16:27:46 +0300 |
---|---|---|
committer | Jonathan Sambrook <jonathan.sambrook@codethink.co.uk> | 2022-11-14 16:52:07 +0300 |
commit | 5691a418e09ccc982cf8f58d40849d46be01be2c (patch) | |
tree | f71721e4047afaa49f535ffd11a5cee6b45893b2 /powerlevel10k.png | |
parent | 8c55eb4fa3a33f9a0a5c52775a253ad3b18b988c (diff) |
Prefer `ip` over `ifconfig` for i/f detection.
`ifconfig`'s formatting doesn't cope well with long interface names. In
these cases it will eat up the whitespace separating the name from the
text "Link" in the output, which makes parsing the output problematic.
e.g. `ifconfig`:
wlp0s20f0u2Link encap:Ethernet HWaddr 00:AA:BB:CC:DD:EE
v.s `ip`:
21: wlp0s20f0u2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc \
mq state UP group default qlen 1000
This commit swaps the order of detection inside
`_p9k_prompt_net_iface_async()`, so that `ip` will be preferred.
`ifconfig` is deprecated by distros in favour of `ip`, so this will
often be an incredibly marginal performance boost :)
NOTE: this commit does not address the problem with using `ifconfig`. I
don't understand the zsh regex, so have not touched it.
Diffstat (limited to 'powerlevel10k.png')
0 files changed, 0 insertions, 0 deletions