2

I have a function that is setup to send status updates to anybar.

function e --description 'Run command' \
           --argument-names command
  anybar yellow; eval $command; anybar green;
end

I am trying to find a way wrap all of my commands that I give through cli to fish in this function.

Does anyone know if this is possible?

1 Answer 1

6

Instead of this method, try adding the following to your config.fish:

function my_preexec --on-event fish_preexec
    anybar yellow
end

function my_postexec --on-event fish_postexec
    anybar green
end

This will run these functions before and after every command, without requiring the potentially-explosive eval.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .