* eat.el (eat-mode): Escape '%' character in title
This commit is contained in:
parent
ccfccf016b
commit
7bff1c4974
2 changed files with 6 additions and 5 deletions
9
eat.el
9
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,
|
||||
|
|
|
@ -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 '%')"
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue