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.
This commit is contained in:
Jiří Techet 2015-05-19 11:55:40 +02:00
parent bd4956b555
commit 09ee4965f7

View File

@ -163,7 +163,7 @@ static const GtkTargetEntry dnd_targets[] =
static gchar **vte_get_child_environment(void)
{
const gchar *exclude_vars[] = {"COLUMNS", "LINES", "TERM", NULL};
const gchar *exclude_vars[] = {"COLUMNS", "LINES", "TERM", "TERM_PROGRAM", NULL};
return utils_copy_environment(exclude_vars, "TERM", "xterm", NULL);
}