chiark / gitweb /
Improve Kermit configuration.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 20 Feb 2012 10:05:29 +0000 (10:05 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 20 Feb 2012 10:05:29 +0000 (10:05 +0000)
  * Rename to mykermrc.

  * Set up (currently empty) shared dialling and network directories,
    and host-specific directories.

dot/kermrc [deleted file]
dot/mykermrc.in [new file with mode: 0644]
kermit/dial.shared [new file with mode: 0644]
kermit/net.shared [new file with mode: 0644]
setup

diff --git a/dot/kermrc b/dot/kermrc
deleted file mode 100644 (file)
index 9620593..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-;;; ---kermit---
-;;;
-;;; Configuration and definitions for Kermit.
-
-set escape-character ^]
-set terminal trigger KERMIT READY TO SERVE...
-
-;; If my terminal is UTF8 then try to use that consistently.  This may not
-;; work, but in my world as it is it's quite likely to.
-local _lc_ctype
-if not def _lc_ctype if def \$(LC_ALL) assign _lc_ctype \$(LC_ALL)
-if not def _lc_ctype if def \$(LC_CTYPE) assign _lc_ctype \$(LC_CTYPE)
-if not def _lc_ctype if def \$(LANG) assign _lc_ctype \$(LANG)
-if match \m(_lc_ctype) *.utf8 {
-       set file character-set utf8
-       set terminal character-set utf8
-}
-
-;; Guest virtual consoles are frequently presented as Unix-domain sockets.
-def UNIX {
-       if < \v(argc) 1 -
-               end 1 Usage: UNIX socket
-       pipe nc -U \%1
-}
-
-;; Synchronize remote terminal size with local window.
-def syncwinsz output stty rows \v(rows) columns \v(cols)\13
diff --git a/dot/mykermrc.in b/dot/mykermrc.in
new file mode 100644 (file)
index 0000000..9baf517
--- /dev/null
@@ -0,0 +1,99 @@
+;;; ---kermit---
+;;;
+;;; Configuration and definitions for Kermit.
+
+assign _profile @profile@/
+assign _dot \v(home).kermit/
+
+;; General stuff.
+set escape-character ^]
+set flow-control /direct-serial rts/cts
+set flow-control /modem rts/cts
+set locus local
+set options directory /brief
+set terminal trigger KERMIT READY TO SERVE...
+set transfer pipes on
+
+;; Dialling parameters.
+set dial country-code 44
+set dial area-code 1223
+set dial display on
+set dial toll-free-area-code 800
+set dial ld-prefix 0
+set dial intl-prefix 00
+
+;; Directories.
+def _dir_exist {
+       undef _dir
+       for \%i 1 \fdim(&v) 1 {
+               if exist \&v[\%i] {
+                       if def _dir assign _dir \m(_dir) \&v[\%i]
+                       else assign _dir \&v[\%i]
+               }
+       }
+}
+
+local \&v
+local \%n
+array dcl v = -
+       \m(_profile)kermit/net.shared -
+       \m(_dot)net.local
+local _dir
+_dir_exist
+set network directory \m(_dir)
+
+array dcl v = -
+       \m(_profile)kermit/dial.shared -
+       \m(_dot)dial.local
+local _dir
+_dir_exist
+set dial directory \m(_dir)
+
+;; If my terminal is UTF8 then try to use that consistently.  This may not
+;; work, but in my world as it is it's quite likely to.
+local _lc_ctype
+if not def _lc_ctype if def \$(LC_ALL) assign _lc_ctype \$(LC_ALL)
+if not def _lc_ctype if def \$(LC_CTYPE) assign _lc_ctype \$(LC_CTYPE)
+if not def _lc_ctype if def \$(LANG) assign _lc_ctype \$(LANG)
+if match \m(_lc_ctype) *.utf8 {
+       set file character-set utf8
+       set terminal character-set utf8
+}
+
+;; Set the HTTP proxy from the environment.
+if def \$(http_proxy) {
+       assign \%n \fsplit(\$(http_proxy),&v,/)
+       set tcp http-proxy \&v[2]
+}
+
+;; Guest virtual consoles are frequently presented as Unix-domain sockets.
+def UNIX {
+       if <= \v(argc) 1 -
+               end 1 Usage: UNIX socket
+       pipe nc -U \%1
+}
+
+;; Connect to a kermit SSH subsystem.
+def KERMSSH {
+       if <= \v(argc) 1 -
+               end 1 Usage: KERMSSH [options] [user@]host
+       set clear-channel on
+       pty ssh -enone -st \%* kermit
+}
+
+;; Console over null-modem cable.
+def CONSOLE {
+       if > \v(argc) 1 set speed \%1
+       if > \v(argc) 2 set serial \%2
+       else set serial 8n1
+       set modem type none
+       set carrier-watch off
+       set clear-channel on
+       connect
+}
+
+;; Synchronize remote terminal size with local window.
+def syncwinsz output stty rows \v(rows) columns \v(cols)\13
+
+;; Local configuration.
+if exist \m(_dot)config take \m(_dot)config
diff --git a/kermit/dial.shared b/kermit/dial.shared
new file mode 100644 (file)
index 0000000..eb54b9a
--- /dev/null
@@ -0,0 +1,2 @@
+;;; Telephone directory.
+
diff --git a/kermit/net.shared b/kermit/net.shared
new file mode 100644 (file)
index 0000000..04ea329
--- /dev/null
@@ -0,0 +1,2 @@
+;;; Directory for network and other virtual connections.
+
diff --git a/setup b/setup
index 09e3005b031f58ed7d4306dc0e7ddf740017babf..cf9dc4c392312842819e85baa1a6b76db3442338 100755 (executable)
--- a/setup
+++ b/setup
@@ -141,7 +141,6 @@ dotfiles="
   guile
   rcrc
   toprc
-  kermrc
   mc-ini:.mc/ini mc-panels.ini:.mc/panels.ini
   aspell.conf
   tclshrc:.tclshrc tclshrc:.wishrc
@@ -179,6 +178,7 @@ echo "      all done."
 ## Substitute things which need substituting.
 dotfilessubst="
   gitconfig
+  mykermrc
   pulse-default.pa.in:.pulse/default.pa"
 echo "Installing dotfiles with substitutions..."
 for d in $dotfilessubst; do