[vte] vte.sh: Remove control chars for window title



commit 8aae59d7c8b8e35555a23f5f80620d32acb18494
Author: Peter Simonyi <pts petersimonyi ca>
Date:   Sun Jun 30 22:12:54 2019 +0200

    vte.sh: Remove control chars for window title
    
    Many of the C0 and C1 control characters other than the expected Esc-\
    or BEL will abort the OSC sequence, and none of them will display
    usefully in a window title, so strip them all.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=743867
    https://gitlab.gnome.org/GNOME/vte/issues/139

 src/vte.sh | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/src/vte.sh b/src/vte.sh
index 6d1a8734..c200493c 100644
--- a/src/vte.sh
+++ b/src/vte.sh
@@ -52,6 +52,7 @@ __vte_osc7 () {
 __vte_prompt_command() {
   local pwd='~'
   [ "$PWD" != "$HOME" ] && pwd=${PWD/#$HOME\//\~\/}
+  pwd="${pwd//[[:cntrl:]]}"
   printf "\033]0;%s@%s:%s\033\\%s" "${USER}" "${HOSTNAME%%.*}" "${pwd}" "$(__vte_osc7)"
 }
 


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