dot/mykermrc.in: More awful hacking to set directories.
[profile] / dot / mykermrc.in
1 ;;; ---kermit---
2 ;;;
3 ;;; Configuration and definitions for Kermit.
4
5 assign _profile @profile@/
6 assign _dot \v(home).kermit/
7
8 ;; General stuff.
9 set escape-character ^]
10 set flow-control /direct-serial rts/cts
11 set flow-control /modem rts/cts
12 set locus local
13 set options directory /brief
14 set terminal trigger KERMIT READY TO SERVE...
15 set transfer pipes on
16
17 ;; Dialling parameters.
18 set dial country-code 44
19 set dial area-code 1223
20 set dial display on
21 set dial toll-free-area-code 800
22 set dial ld-prefix 0
23 set dial intl-prefix 00
24
25 ;; Directories.
26 def _set_dir {
27 local what list awful
28 assign what \%1
29 undef list
30 shift
31
32 for \%i 1 \v(argc)-1 1 {
33 if exist \%1 {
34 if def list assign list \m(list) \%1
35 else assign list \%1
36 }
37 shift
38 }
39 assign awful { set \m(what) directory \m(list) }
40 do awful
41 }
42 _set_dir network -
43 \m(_profile)kermit/net.shared -
44 \m(_dot)net.local
45 _set_dir dial -
46 \m(_profile)kermit/dial.shared -
47 \m(_dot)dial.local
48
49 ;; If my terminal is UTF8 then try to use that consistently. This may not
50 ;; work, but in my world as it is it's quite likely to.
51 local _lc_ctype
52 if not def _lc_ctype if def \$(LC_ALL) assign _lc_ctype \$(LC_ALL)
53 if not def _lc_ctype if def \$(LC_CTYPE) assign _lc_ctype \$(LC_CTYPE)
54 if not def _lc_ctype if def \$(LANG) assign _lc_ctype \$(LANG)
55 if match \m(_lc_ctype) *.utf8 {
56 set file character-set utf8
57 set terminal character-set utf8
58 }
59
60 ;; Set the HTTP proxy from the environment.
61 if def \$(http_proxy) {
62 assign \%n \fsplit(\$(http_proxy),&v,/)
63 set tcp http-proxy \&v[2]
64 }
65
66 ;; Guest virtual consoles are frequently presented as Unix-domain sockets.
67 def UNIX {
68 if <= \v(argc) 1 -
69 end 1 Usage: UNIX socket
70 pipe nc -U \%1
71 }
72
73 ;; Connect to a kermit SSH subsystem.
74 def KERMSSH {
75 if <= \v(argc) 1 -
76 end 1 Usage: KERMSSH [options] [user@]host
77 set clear-channel on
78 pty ssh -enone -st \%* kermit
79 }
80
81 ;; Console over null-modem cable.
82 def CONSOLE {
83 if > \v(argc) 1 set speed \%1
84 if > \v(argc) 2 set serial \%2
85 else set serial 8n1
86 set modem type none
87 set carrier-watch off
88 set clear-channel on
89 connect
90 }
91
92 ;; Synchronize remote terminal size with local window.
93 def syncwinsz output stty rows \v(rows) columns \v(cols)\13
94
95 ;; Local configuration.
96 if exist \m(_dot)config take \m(_dot)config