;;; ---kermit--- ;;; ;;; Configuration and definitions for Kermit. assign _profile @profile@/ assign _dot \v(home).kermit/ ;; General stuff. set command recall-buffer-size 100 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 ;; Set the prompt string. def _host \fword(\v(host),1,.) def _pwd \freplace(\freplace(//\v(dir)/,//\v(home),~/),//,) local _hack asg _hack set prompt {C-Kermit \v(user)@\m(_host) \m(_pwd)>} do _hack ;; 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 _set_dir { local what list awful assign what \%1 undef list shift for \%i 1 \v(argc)-1 1 { if exist \%1 { if def list assign list \m(list) \%1 else assign list \%1 } shift } assign awful { set \m(what) directory \m(list) } do awful } _set_dir network - \m(_profile)kermit/net.shared - \m(_dot)net.local _set_dir dial - \m(_profile)kermit/dial.shared - \m(_dot)dial.local ;; 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. set file character-set utf8 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 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 ;; Special cases for particular target hosts. def GUVNOR { set key 127 \8 telnet guvnor.distorted.org.uk } def JUMPTS { local pass set host /network-type:pty ssh -enone -t \%1 while true { input 15 \fpattern({{{password:,exit}}}) if fail end 1 failed to connect if equal \v(inmatch) exit break if equal \v(inmatch) password: { if ! def pass askq pass {password: } output \m(pass)\13 } } } def FENDERCON { set input echo off jumpts mdw@ts-tfm8.jump.net.uk output 1\13 set control prefixed 30 connect } def ARDUINO { set terminal lf-display crlf set line \%1 set speed 9600 set serial 8n1 set modem type none set carrier-watch off set clear-channel on connect set line } ;; Local configuration. if exist \m(_dot)config take \m(_dot)config