[vte/vte-0-66] vte.sh: Fix the check for PROMPT_COMMAND when it is unset



commit 1fe2f3e9e11d1b8b0e45698a268b77e8f52e25db
Author: Christian Persch <chpe src gnome org>
Date:   Sat Sep 25 10:50:29 2021 +0200

    vte.sh: Fix the check for PROMPT_COMMAND when it is unset
    
    declare "helpfully" outputs on stdout for existing variables, but on stderr
    for nonexistent ones.
    
    Fixes: https://gitlab.gnome.org/GNOME/vte/-/issues/37

 src/vte.sh.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/vte.sh.in b/src/vte.sh.in
index 1aa40ba4..242d6c42 100644
--- a/src/vte.sh.in
+++ b/src/vte.sh.in
@@ -48,7 +48,7 @@ if [[ -n "${BASH_VERSION:-}" ]]; then
     # On older bash, we can only overwrite the whole PROMPT_COMMAND, so must
     # use the __vte_prompt_command function which also sets the title.
 
-    if [[ "$(declare -p PROMPT_COMMAND)" =~ "declare -a" ]]; then
+    if [[ "$(declare -p PROMPT_COMMAND 2>&1)" =~ "declare -a" ]]; then
        PROMPT_COMMAND+=(__vte_osc7)
     else
        PROMPT_COMMAND="__vte_prompt_command"


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