From 09ee4965f7ad56fe03dbd3b87f3d28842b447f0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Techet?= Date: Tue, 19 May 2015 11:55:40 +0200 Subject: [PATCH] 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vte.c b/src/vte.c index 304ad095..eb0a392b 100644 --- a/src/vte.c +++ b/src/vte.c @@ -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); }