[geany/geany] 09ee49: Add TERM_PROGRAM to excluded environment variables for VTE

Jiří Techet git-noreply at xxxxx
Tue May 19 09:55:40 UTC 2015


Branch:      refs/heads/master
Author:      Jiří Techet <techet at gmail.com>
Committer:   Jiří Techet <techet at gmail.com>
Date:        Tue, 19 May 2015 09:55:40 UTC
Commit:      09ee4965f7ad56fe03dbd3b87f3d28842b447f0c
             https://github.com/geany/geany/commit/09ee4965f7ad56fe03dbd3b87f3d28842b447f0c

Log Message:
-----------
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.


Modified Paths:
--------------
    src/vte.c

Modified: src/vte.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -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);
 }



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list