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;

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?


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

function my_preexec --on-event fish_preexec
    anybar yellow

function my_postexec --on-event fish_postexec
    anybar green

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.