[vte/vte-0-50-ntfy-scroll: 2/5] vte.sh: Emit OSC 777 from PROMPT_COMMAND



commit fea22a41c0fcef5e055c83a6dd718ef3426979d7
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Jan 29 13:09:17 2015 +0100

    vte.sh: Emit OSC 777 from PROMPT_COMMAND
    
    https://bugzilla.gnome.org/show_bug.cgi?id=711059

 src/vte.sh |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/vte.sh b/src/vte.sh
index 2d211ca..1c0543b 100644
--- a/src/vte.sh
+++ b/src/vte.sh
@@ -50,9 +50,11 @@ __vte_osc7 () {
 }
 
 __vte_prompt_command() {
+  local command=$(HISTTIMEFORMAT= history 1 | sed 's/^ *[0-9]\+ *//')
+  command="${command//;/ }"
   local pwd='~'
   [ "$PWD" != "$HOME" ] && pwd=${PWD/#$HOME\//\~\/}
-  printf "\033]0;%s@%s:%s\007%s" "${USER}" "${HOSTNAME%%.*}" "${pwd}" "$(__vte_osc7)"
+  printf "\033]777;notify;Command completed;%s\007\033]0;%s@%s:%s\007%s" "${command}" "${USER}" 
"${HOSTNAME%%.*}" "${pwd}" "$(__vte_osc7)"
 }
 
 case "$TERM" in


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