From 7802dbb224863dcae3f69bf0e124f90635c496b2 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Thu, 29 Jan 2015 13:09:17 +0100 Subject: [PATCH 2/9] vte.sh: Emit OSC 777 from PROMPT_COMMAND For some reason, the three consecutive backslashes break the parsing. As Christian Persch suggested, replacing the double quotes with singles fixes it. https://bugzilla.gnome.org/show_bug.cgi?id=711059 --- src/vte.sh.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vte.sh.in b/src/vte.sh.in index 242d6c42..50242223 100644 --- a/src/vte.sh.in +++ b/src/vte.sh.in @@ -33,10 +33,12 @@ __vte_osc7 () { } __vte_prompt_command() { + local command=$(HISTTIMEFORMAT= history 1 | sed 's/^ *[0-9]\+ *//') + command="${command//;/ }" local pwd='~' [ "$PWD" != "$HOME" ] && pwd=${PWD/#$HOME\//\~\/} pwd="${pwd//[[:cntrl:]]}" - printf "\033]0;%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${pwd}" + printf '\033]777;notify;Command completed;%s\033\\\033]0;%s@%s:%s\033\\' "${command}" "${USER}" "${HOSTNAME%%.*}" "${pwd}" __vte_osc7 } -- 2.43.0