Under OS X you can drag and drop a file from the Finder (or anywhere else) onto a Terminal window and the file’s path will be inserted as if you had typed it in. Recently, filenames with spaces have stopped being handled correctly: if the file path contained spaces before, the Terminal would get a version enclosed in double quotes or else with each space preceded by a backslash. Now the entire file path is just dumped in, and if it contains any spaces then I have to go back and escape them myself.
I have played around with the “shells open with” setting and it seems that the correct escaping happens when the shell is
/bin/bash (GNU bash 3.2.57(1)-release) or
/bin/zsh (zsh 5.0.8) but not when the shell is my manually-installed
/usr/local/bin/zsh (zsh 5.2). I’m on OS X 10.11.2.
Was there a change in zsh that could have messed up dragging and dropping in Terminal? Or is Terminal itself using some kind of whitelist of shells that doesn’t include my zsh?
Edit: I installed zsh 5.0.8 at
/usr/local/bin/zsh and filenames are escaped properly for that shell. It seems that some change to zsh between versions 5.0.8 and 5.2 made this stop working.