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