This doesn't work on my machine: # This is a bit brittle as it depends on PATH_MAX. # We could use sysconf.. bad_pwd="/${(l:16000:: :):-}" print ${bad_pwd:P} | wc -c 0:modifier ':P' with path too long >16002 The modification fails with error and output zsh: path expansion failed, using root directory 2 pws