[vte] vte.sh: Add vte.csh, a tcsh counterpart of vte.sh



commit 3bd204b9400650ff75197b4a1ab65711a58b5388
Author: Carlos Santos <casantos redhat com>
Date:   Wed Jan 22 18:06:28 2020 +0100

    vte.sh: Add vte.csh, a tcsh counterpart of vte.sh
    
    Use vte-urlencode-cwd in the precmd alias. This overrides an existing precmd
    and can also be overriten, like happens with the PROMPT_COMMAND variable
    in vte.sh.
    
    Fixes: https://gitlab.gnome.org/GNOME/vte/issues/206

 src/meson.build | 10 ++++++++++
 src/vte.csh.in  | 24 ++++++++++++++++++++++++
 2 files changed, 34 insertions(+)
---
diff --git a/src/meson.build b/src/meson.build
index 78dba0c5..a385716f 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -533,6 +533,16 @@ endforeach
 
 # Shell integration
 
+vte_csh = configure_file(
+  input: 'vte.csh.in',
+  output: '@BASENAME@',
+  configuration: {
+    'libexecdir': vte_prefix / vte_libexecdir,
+  },
+  install: true,
+  install_dir: vte_sysconfdir / 'profile.d',
+)
+
 vte_sh = configure_file(
   input: 'vte.sh.in',
   output: '@BASENAME@',
diff --git a/src/vte.csh.in b/src/vte.csh.in
new file mode 100644
index 00000000..e809d9c0
--- /dev/null
+++ b/src/vte.csh.in
@@ -0,0 +1,24 @@
+# Copyright © 2019 Red Hat, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+# Red Hat Author(s): Carlos Santos
+
+# exit if non-interactive, csh, no terminal or old VTE versions
+if ( ! $?prompt | ! $?tcsh | ! $?TERM | 0$VTE_VERSION < 3405) exit
+
+switch($TERM)
+  case xterm*:
+    alias precmd 'echo -n "\e]7;file://$HOST"; @libexecdir@/vte-urlencode-cwd; echo -n "\e\\"'
+endsw


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