dot/mykermrc.in: More awful hacking to set directories.
[profile] / dot / mykermrc.in
CommitLineData
8508a859
MW
1;;; ---kermit---
2;;;
3;;; Configuration and definitions for Kermit.
4
5assign _profile @profile@/
6assign _dot \v(home).kermit/
7
8;; General stuff.
9set escape-character ^]
10set flow-control /direct-serial rts/cts
11set flow-control /modem rts/cts
12set locus local
13set options directory /brief
14set terminal trigger KERMIT READY TO SERVE...
15set transfer pipes on
16
17;; Dialling parameters.
18set dial country-code 44
19set dial area-code 1223
20set dial display on
21set dial toll-free-area-code 800
22set dial ld-prefix 0
23set dial intl-prefix 00
24
25;; Directories.
2351081f
MW
26def _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
8508a859 36 }
2351081f 37 shift
8508a859 38 }
2351081f
MW
39 assign awful { set \m(what) directory \m(list) }
40 do awful
8508a859 41}
2351081f 42_set_dir network -
8508a859
MW
43 \m(_profile)kermit/net.shared -
44 \m(_dot)net.local
2351081f 45_set_dir dial -
8508a859
MW
46 \m(_profile)kermit/dial.shared -
47 \m(_dot)dial.local
8508a859
MW
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.
51local _lc_ctype
52if not def _lc_ctype if def \$(LC_ALL) assign _lc_ctype \$(LC_ALL)
53if not def _lc_ctype if def \$(LC_CTYPE) assign _lc_ctype \$(LC_CTYPE)
54if not def _lc_ctype if def \$(LANG) assign _lc_ctype \$(LANG)
55if 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.
61if 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.
67def 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.
74def 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.
82def 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.
93def syncwinsz output stty rows \v(rows) columns \v(cols)\13
94
95;; Local configuration.
96if exist \m(_dot)config take \m(_dot)config