feat: fnalias works with color
This commit is contained in:
parent
ff220bf4b7
commit
4fe4f8864e
@ -12,8 +12,8 @@ alias wconf="$EDITOR $HOME/.config/awesome"
|
|||||||
alias zshconf="$EDITOR $ZDOTDIR/.zshrc && . $ZDOTDIR/.zshrc"
|
alias zshconf="$EDITOR $ZDOTDIR/.zshrc && . $ZDOTDIR/.zshrc"
|
||||||
|
|
||||||
function fnalias() {
|
function fnalias() {
|
||||||
# alias alias_cmd='cmd'
|
|
||||||
cmd="$(alias "$2")"
|
cmd="$(alias "$2")"
|
||||||
|
shell="$(ps -q "$$" -o 'comm=')"
|
||||||
|
|
||||||
if [ -n "$cmd" ]; then
|
if [ -n "$cmd" ]; then
|
||||||
# remove everything before and including the first =
|
# remove everything before and including the first =
|
||||||
@ -24,8 +24,8 @@ function fnalias() {
|
|||||||
cmd="$2"
|
cmd="$2"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$1 -- $(echo "$cmd") "${@:3}"
|
$shell -c "$1 $(echo "$cmd" | sed 's/--color=.\+/--color=force/') ${@:3}"
|
||||||
}
|
}
|
||||||
|
|
||||||
alias watch='fnalias watch'
|
alias watch='fnalias "watch -c"'
|
||||||
alias xargs='fnalias xargs'
|
alias xargs='fnalias xargs'
|
||||||
|
Loading…
Reference in New Issue
Block a user