summaryrefslogtreecommitdiff
path: root/plugins/systemadmin
diff options
context:
space:
mode:
authorBen Iofel <github@iofel.me>2022-11-15 18:29:48 +0000
committerGitHub <noreply@github.com>2022-11-15 19:29:48 +0100
commit4392d3a923eddd4e9d0f9b17a1e995cc9aa5cc96 (patch)
treea63bb3644e258ff4589050f1246c3068c94c8d08 /plugins/systemadmin
parent94584e2a7337e0a7f5af45e2c97ca6d0770e67a1 (diff)
downloadzsh-4392d3a923eddd4e9d0f9b17a1e995cc9aa5cc96.tar.gz
zsh-4392d3a923eddd4e9d0f9b17a1e995cc9aa5cc96.tar.bz2
zsh-4392d3a923eddd4e9d0f9b17a1e995cc9aa5cc96.zip
feat(systemadmin): color `ip` if shell is interactive (#11107)
Diffstat (limited to 'plugins/systemadmin')
-rw-r--r--plugins/systemadmin/systemadmin.plugin.zsh8
1 files changed, 8 insertions, 0 deletions
diff --git a/plugins/systemadmin/systemadmin.plugin.zsh b/plugins/systemadmin/systemadmin.plugin.zsh
index 8e5e0af71..9b5159ff1 100644
--- a/plugins/systemadmin/systemadmin.plugin.zsh
+++ b/plugins/systemadmin/systemadmin.plugin.zsh
@@ -33,6 +33,14 @@ alias pscpu10='ps -e -o pcpu,cpu,nice,state,cputime,args|sort -k1,1n -nr | head
# top10 of the history
alias hist10='print -l ${(o)history%% *} | uniq -c | sort -nr | head -n 10'
+function ip() {
+ if [ -t 1 ]; then
+ command ip -color "$@"
+ else
+ command ip "$@"
+ fi
+}
+
# directory LS
function dls() {
print -l *(/)