I know zsh has a preexec hook that fires before the command is executed, but is there one that fires after the command has been initiated but before the output is displayed to the screen? I ask because I want to display something based on if there was/will be actual output.
cd dir does not output anything
ls dir outputs stuff
In that example, I want to display:
Output:\n before the ls directory display but not when
cd is run since it doesn't have a display. I want it to look like:
~ $: cd dir ~/dir $: ls . Output: total 464 drwxr-xr-x+ 55 eddie staff 1.8K May 2 11:07 . drwxr-xr-x 6 root admin 204B Apr 22 13:48 .. ~/dir $
I don't just want to wrap cd and ls. Those were examples. I want it to be for every command.