Fix for zsh issue

@graemechristie  @davidfowl 
Merging the changes from kvm repo to home repo so that the fix is in the kvm installed by homebrew
sure I tested this out in both bash and zsh. It works without issues. This PR is actually merged in the kvm repo. I am porting the fix