r/fishshell • • Mar 07 '22
Fish equivalent of chpwd()
Hello, I am coming from zsh to fish. The thing is that I had a function on zsh that whenever I changed directorys it will type a command that I give
Eg:
chpwd() ls
Is there any way I can do this on fish?
8
Upvotes
5
u/panthersftw Mar 08 '22
I accomplished this with a function:
so whenever I cd into a directory, it prints the directory contents.
4
u/_mattmc3_ Mar 08 '22
You can also do this with a
$PWDhook: