I can set Chrome proxy by Tor. Can use Tor socks5 to set shell proxy? I tried but failed. I think no way to do it.
I don't have zsh installed to try it, but you could try using it with torsocks. For example with bash, you can run
torsocks bash. This will launch a bash shell that will redirect new TCP network connections through Tor. It would probably work for zsh as well with
It's important to note that not all network traffic will be redirected through Tor when using torsocks (torsocks is not a sandbox and there is no fail-safe). Non-TCP network traffic will be sent without Tor, and any applications that access the network without using libc will also be sent without Tor.