[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/eat 7bff1c4974 1/2: * eat.el (eat-mode): Escape '%' charac
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/eat 7bff1c4974 1/2: * eat.el (eat-mode): Escape '%' character in title |
Date: |
Thu, 14 Sep 2023 12:59:40 -0400 (EDT) |
branch: elpa/eat
commit 7bff1c4974d5d9a1e84c2ad1c640e141e247ad13
Author: Illia Ostapyshyn <ilya.ostapyshyn@gmail.com>
Commit: Akib Azmain Turja <akib@disroot.org>
* eat.el (eat-mode): Escape '%' character in title
---
eat.el | 9 +++++----
integration/zsh | 2 +-
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/eat.el b/eat.el
index bdf296d9c7..cf7ff84a69 100644
--- a/eat.el
+++ b/eat.el
@@ -6253,10 +6253,11 @@ mouse-3: Switch to char mode"
'(" "
(:propertize
(:eval
- (when (and eat--terminal
- (not (string-empty-p (eat-term-title
- eat--terminal))))
- (format "(%s)" (eat-term-title eat--terminal))))
+ (when-let* (((eat--terminal))
+ (title (eat-term-title eat--terminal))
+ ((not (string-empty-p title))))
+ (format "(%s)" (string-replace "%" "%%"
+ title))))
help-echo "Title"))))))
(eat-emacs-mode)
;; Make sure glyphless character don't display a huge box glyph,
diff --git a/integration/zsh b/integration/zsh
index 1fb4d79060..66ea0e6f16 100644
--- a/integration/zsh
+++ b/integration/zsh
@@ -30,7 +30,7 @@ __eat_precmd () {
"$(printf "%s" "$PWD" | base64)"
# Update title.
# "${PWD/$HOME/'~'}" converts "/home/akib/org/" to "~/org/".
- # The next one is substituted with '$', or '#' if we're "root".
+ # The next one is substituted with '%', or '#' if we're "root".
printf '\e]2;%s@%s:%s%s\e\\' "$USER" "$HOST" "${PWD/$HOME/~}" \
"$(test $UID -eq 0 && echo '#' || echo '%')"
}