[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/eat 01f5f3b2af 4/6: Refactor shell integration enabling co
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/eat 01f5f3b2af 4/6: Refactor shell integration enabling code |
Date: |
Sun, 4 Dec 2022 06:58:40 -0500 (EST) |
branch: elpa/eat
commit 01f5f3b2af20875a67c1ace1992812953d9a1ba6
Author: Akib Azmain Turja <akib@disroot.org>
Commit: Akib Azmain Turja <akib@disroot.org>
Refactor shell integration enabling code
* integration/bash (__eat_enable_integration): New function.
* integration/bash: Move enabling code to dedicated function.
---
integration/bash | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/integration/bash b/integration/bash
index bd0168a548..49fdee29cd 100644
--- a/integration/bash
+++ b/integration/bash
@@ -50,10 +50,9 @@ __eat_before_exec () {
fi
}
-# Add '__eat_prompt_command' as the last element of 'PROMPT_COMMAND'.
-if test -z "$__eat_bash_integration_enabled"
-then
- __eat_bash_integration_enabled=yes
+__eat_enable_integration ()
+{
+ __eat_integration_enabled=yes
PS1='\[\e]2;\u@\h:\w$\e\\\]'"$PS1"
PROMPT_COMMAND+=(__eat_prompt_command)
trap '__eat_before_exec' DEBUG
@@ -73,7 +72,10 @@ then
done
# Step 2.2: Assign the first element.
PROMPT_COMMAND[0]=__eat_before_prompt_command
-fi
+}
+
+# Enable.
+test -z "$__eat_integration_enabled" && __eat_enable_integration
# Local Variables:
# mode: sh
- [nongnu] elpa/eat updated (85c0c16380 -> ccc405ec14), ELPA Syncer, 2022/12/04
- [nongnu] elpa/eat 0887bd6a7d 3/6: Update title automatically in shell integration, ELPA Syncer, 2022/12/04
- [nongnu] elpa/eat 468fe893cf 1/6: * term/eat.el: New file., ELPA Syncer, 2022/12/04
- [nongnu] elpa/eat 226ff56932 2/6: * README.org (Quelpa): Update recipe., ELPA Syncer, 2022/12/04
- [nongnu] elpa/eat a95ca85927 5/6: * eat.el: Fix bright faces face definitions, ELPA Syncer, 2022/12/04
- [nongnu] elpa/eat ccc405ec14 6/6: Fix Bash integration, ELPA Syncer, 2022/12/04
- [nongnu] elpa/eat 01f5f3b2af 4/6: Refactor shell integration enabling code,
ELPA Syncer <=