pty: Set env var with vte version

This is necessary so that we'll be able to check whether to use the
vte.sh script in PS1.
(cherry picked from commit 8bea17d1a36abb635e751e4daf4315b0bf20b26e)
prompt: Make __vte_ps1 only print anything if running under vte
(cherry picked from commit 5f80578b383a3378274c78f6867b1fcb05d42ea3)
prompt: Set PROMPT_COMMAND

Use PROMPT_COMMAND to set the cwd. This works for both login and non-login
shells (at least under F17 and should also work for any other distro that
sources /etc/profile.d/*.sh both ways).
(cherry picked from commit b307d45e8b2dd27a3881852c29f4a6f0443d5348)
prompt: zsh compatibility
(cherry picked from commit fa9171fc7b9ed0f46e26dec32e2755c1c48c4c70)