[vte/wip/issue-206: 4/4] vte.sh: Add vte.csh, a tcsh counterpart of vte.sh



commit e6ecfa9f0d021ae102612856c4f2085b4376f2d1
Author: Carlos Santos <casantos redhat com>
Date:   Mon Jan 20 21:13:24 2020 +0100

    vte.sh: Add vte.csh, a tcsh counterpart of vte.sh
    
    Use vte-urlencode in the precmd alias. This overrides an existing precmd
    and can also be overriten, like happens with the PROMPT_COMMAND variable
    in vte.sh.

 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 7894549a..ce5034c5 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..5151df81
--- /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://$HOSTNAME"; @libexecdir@/vte-urlencode; echo -n "\e\\"'
+endsw


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