Add TERM_PROGRAM to excluded environment variables for VTE
commit09ee4965f7ad56fe03dbd3b87f3d28842b447f0c
authorJiří Techet <techet@gmail.com>
Tue, 19 May 2015 09:55:40 +0000 (19 11:55 +0200)
committerJiří Techet <techet@gmail.com>
Tue, 19 May 2015 09:55:40 +0000 (19 11:55 +0200)
tree79f896f60d6d258573e9637d3d18a36176412c4a
parentbd4956b555dfccb7546796866261d7946450536d
Add TERM_PROGRAM to excluded environment variables for VTE

On OS X /etc/bashrc does some Apple-terminal-specific thing:

# Tell the terminal about the working directory at each prompt.
if [ "$TERM_PROGRAM" == "Apple_Terminal" ] && [ -z "$INSIDE_EMACS" ]; then
    update_terminal_cwd() {
        # Identify the directory using a "file:" scheme URL,
        # including the host name to disambiguate local vs.
        # remote connections. Percent-escape spaces.
        local SEARCH=' '
        local REPLACE='%20'
        local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}"
        printf '\e]7;%s\a' "$PWD_URL"
    }
    PROMPT_COMMAND="update_terminal_cwd; $PROMPT_COMMAND"
fi

This however doesn't work in VTE when Geany is started from the Terminal
application so we get some strange prefix for the prompt. Unset the
TERM_PROGRAM variable so it isn't set to Apple_Terminal when running
inside VTE.
src/vte.c