Terminal doesn’t do anything with internet at all, so there is no proxy in it.
The programs you are running in terminal mostly use curl to transfer
data, so we should tell curl to use proxy.
As it’s manual says we should set this two environment variables:
$ export http_proxy="http://127.0.0.1:2081"
$ export https_proxy=$http_proxy
Disable it when you are done:
$ unset http_proxy https_proxy
Make the process easier by making a shell function to toggle proxy.
proxy_connect=0
PS2=$PS1
toggle_proxy() {
  if [[ "$proxy_connect" -eq 0 ]]; then
    export http_proxy="http://127.0.0.1:2080"
    export https_proxy=$http_proxy
    proxy_connect=1
    echo "proxy enabled"
    PS1="%{$fg[red]%}][proxy]%{$reset_color%}$%b "
  else
    unset http_proxy https_proxy
    proxy_connect=0
    echo "proxy disabled"
    PS1=$PS2
  fi
}