Is it possible to make bash run clear && ls -A --color
whenever I hit enter on an empty line?
I don't know it that's relevant, but I'm using set -o vi
for vi mode.
Is it possible to make bash run clear && ls -A --color
whenever I hit enter on an empty line?
I don't know it that's relevant, but I'm using set -o vi
for vi mode.
This is possible by setting your PROMPT_COMMAND as such.
PROMPT_COMMAND='h=$(fc -l -1); h=${h%% *}; (( h != oh )) || { clear && ls -A --color; }; oh=$h'
clear && ls -A --color
– Chris May 08 '18 at 03:18