Thanks for the clarification. There is currently no API to achieve this, but one of the enhancements planned for the near future would actually make this possible - we would like to enhance the custom command support to make it possible for custom commands to read or change session's environment variables. If we also add a Unix-like PS1 variable to manipulate the prompt, you would be able to achieve your goal.
Because this is a rather simple feature to add, I have raised its priority. We are currently in busy finishing the next release, but when we are done with that, we'll look into this and very likely provide a beta soon. I will keep you updated.