[vte/vte-0-34] prompt: Make __vte_ps1 only print anything if running under vte



commit 5f80578b383a3378274c78f6867b1fcb05d42ea3
Author: Christian Persch <chpe gnome org>
Date:   Mon Apr 29 12:37:17 2013 +0200

    prompt: Make __vte_ps1 only print anything if running under vte

 src/vte.sh |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/vte.sh b/src/vte.sh
index db4c6bf..d186305 100644
--- a/src/vte.sh
+++ b/src/vte.sh
@@ -31,8 +31,11 @@ __vte_urlencode() (
   done
 )
 
-__vte_ps1() {
+__vte_ps1() (
+  # Only print anything if running in an interactive shell under vte >= 0.34.5
+  [ -n "$PS1" -a "${VTE:-0}" -ge 3405 ] || return
+
   printf "\033]7;file://%s" ${HOSTNAME:-$(hostname)}
   __vte_urlencode "$PWD"
   printf "\a"
-}
+)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]