30 lines
1011 B
Diff
30 lines
1011 B
Diff
From 1fe2f3e9e11d1b8b0e45698a268b77e8f52e25db Mon Sep 17 00:00:00 2001
|
|
From: Christian Persch <chpe@src.gnome.org>
|
|
Date: Sat, 25 Sep 2021 10:50:29 +0200
|
|
Subject: [PATCH] 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"
|
|
--
|
|
2.32.0
|
|
|