ZSH DIRSTACK Script from Arch Wiki FIX for File Managergeschrieben am Dienstag, 1. Mai 2018 um 13:26 Uhr.
if you find this post, you have a problem with ZSH and your term emulator. In my case, it was a problem with zsh and rxvt-unicode. You cannot open a specified directory like urxvt -cd /, so zsh ignores the given path from -cd switch.
This article is for you, if you use the following code from wiki.archlinux.org in your .zshrc:
Comment out the highlighted line (line 4), because it overrides the -cd switch behaviour and change the current directory automatically to your last visited directoy. It is a nice tweak, but destroys the functionality of a file manager like spacefm to open a terminal in the current working directory (e.g. in spacefm: press f4). To open the previous directory, you can use cd -1 manually to enter the folder.
So you only have to comment out the previous line of code to get a working zsh installation.