[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
terminal emulator in 7.2
You might find this helpful. I set *META-SENDS-ESCAPE-IN-TELNET* to T
in my LISPM-INIT file. Let me know what you hear-- I am using TELNET
a lot myself.
cut here-> ----------------------------------------------------------------
;;; -*- Mode: LISP; Syntax: Common-lisp; Package: USER; Base: 10; Patch-File: T -*-
;;; Patch file for Private version 0.0
;;; Reason: Teach Telnet that :ULTRIX is a kind of :UNIX.
;;; (lisp:pushnew :ultrix telnet:*SYSTEM-TYPES-THAT-REFUSE-OVERSTRIKING*)
;;; (lisp:pushnew (:ultrix VT100-TERMINAL-SIMULATOR) telnet:*HOST-DEFAULT-TERMINAL-SIMULATORS*)
;;; Cause the META key to send an #\ESCAPE, so EMACS will work like ZMACS.
;;; Written by Barr, 4/11/88 13:16:01
;;; while running on STRAWBERRY from Fep0:>Genera-7-2.load.1
;;; with Genera 7.2, Experimental Logical Pathnames Translation Files NEWEST, IP-TCP 67.5,
;;; Experimental Cronus Distributed Operating System 13.3,
;;; Experimental Cronus Commands 5.1,
;;; Experimental Cronus Manager Development Tools 11.0,
;;; Experimental Mike Dean's telephone forwarding service 2.0,
;;; Experimental Mike Dean's hacks & utilities 3.0, microcode 3650-MIC 420, FEP 206,
;;; FEP0:>g206-lisp.flod(6), FEP0:>g206-loaders.flod(6), FEP0:>g206-info.flod(6),
;;; FEP0:>g206-debug.flod(1), Machine serial number 30147,
;;; IP/TCP patches required for Cronus (from CRONUS:BASIC;NETWORK-PATCHES.LISP.12),
;;; SI:PROCESS-NAME patche for Cronus (from CRONUS:BASIC;PROCESS-NAME-PATCHES.LISP.6).
;;; Patch file for Private version 0.0
;;; Written by Barr, 4/14/88 16:58:40
;;; while running on STRAWBERRY from Fep0:>Genera-7-2.load.1
;;; with Genera 7.2, Experimental Logical Pathnames Translation Files NEWEST, IP-TCP 67.5,
;;; Experimental Cronus Distributed Operating System 13.3,
;;; Experimental Cronus Commands 5.1,
;;; Experimental Cronus Manager Development Tools 11.0,
;;; Experimental Mike Dean's telephone forwarding service 2.0,
;;; Experimental Mike Dean's hacks & utilities 3.0, Experimental CASES Example 5.0,
;;; microcode 3650-MIC 420, FEP 206, FEP0:>g206-lisp.flod(6),
;;; FEP0:>g206-loaders.flod(6), FEP0:>g206-info.flod(6), FEP0:>g206-debug.flod(1),
;;; Machine serial number 30147,
;;; IP/TCP patches required for Cronus (from CRONUS:BASIC;NETWORK-PATCHES.LISP.12),
;;; SI:PROCESS-NAME patche for Cronus (from CRONUS:BASIC;PROCESS-NAME-PATCHES.LISP.6),
;;; Telnet patches treating :ULTRIX correctly (i.e.,
;;; like :UNIX) (from STRAWBERRY:>Barr>telnet-7-2-patches.lisp.3).
(SYSTEM-INTERNALS:FILES-PATCHED-IN-THIS-PATCH-FILE
"SYS:NETWORK;TELNET.LISP.1565")
(NOTE-PRIVATE-PATCH "Telnet patches treating :ULTRIX correctly (i.e., like :UNIX)")
;=====================================
(SYSTEM-INTERNALS:BEGIN-PATCH-SECTION)
(SYSTEM-INTERNALS:PATCH-SECTION-SOURCE-FILE "SYS:NETWORK;TELNET.LISP.1565")
(SYSTEM-INTERNALS:PATCH-SECTION-ATTRIBUTES
"-*- Mode: LISP; Package: TELNET; Base: 8 -*-")
(lisp:pushnew :ultrix telnet:*SYSTEM-TYPES-THAT-REFUSE-OVERSTRIKING*)
;=====================================
(SYSTEM-INTERNALS:BEGIN-PATCH-SECTION)
(SYSTEM-INTERNALS:PATCH-SECTION-SOURCE-FILE "SYS:NETWORK;TELNET.LISP.1565")
(SYSTEM-INTERNALS:PATCH-SECTION-ATTRIBUTES
"-*- Mode: LISP; Package: TELNET; Base: 8 -*-")
(lisp:pushnew '(:ultrix telnet:VT100-TERMINAL-SIMULATOR) telnet:*HOST-DEFAULT-TERMINAL-SIMULATORS*)
;=====================================
(SYSTEM-INTERNALS:BEGIN-PATCH-SECTION)
(SYSTEM-INTERNALS:PATCH-SECTION-SOURCE-FILE "SYS:NETWORK;TELNET.LISP.1565")
(SYSTEM-INTERNALS:PATCH-SECTION-ATTRIBUTES
"-*- Mode: LISP; Package: TELNET; Base: 8 -*-")
D,#TD1PsT[Begin using 006 escapes](1 0 (NIL 0) (:DEVICE-FONT FONTS:TR10BI :NORMAL) "TR10BI");; I use GNUEMACS often, so...
(2 0 (NIL 0) (NIL NIL NIL) "CPTFONT")(defvar *meta-sends-escape-in-telnet* nil
"When non-NIL, causes any character with CHAR-META-BIT set to be preceded by #\ESCAPE.
This has the effect of making #\M-F on the Lispm keyboard translate into /"Escape F/"
which is Meta-F in EMACS.")
(DEFMETHOD (:TYPEIN-TOP-LEVEL NVT-WINDOW) ()
(LET ((*TERMINAL-STREAM* SELF)
(*VIEWPORT-STREAM* VIEWPORT-STREAM)
(*TERMINAL-SCREEN* SELF #|(SEND SELF :GET-PANE 'TERMINAL-SCREEN)|#)
(TERMINAL-IO (SEND SELF :TYPEOUT-WINDOW)))
(LOOP DOING
(SEND TERMINAL-IO :EXPOSE-FOR-TYPEOUT)
(MULTIPLE-VALUE-BIND (HOST OPTIONS)
(IF CONNECT-TO
(PROG1 CONNECT-TO (SETQ CONNECT-TO NIL))
(PARSE-HOST-AND-OPTIONS))
(LEXPR-SEND SELF :CONNECT HOST OPTIONS)
(LET ((REASON
(CATCH 'NVT-DONE
(CONDITION-CASE (ERROR)
(UNWIND-PROTECT
(ERROR-RESTART ((ERROR BREAK ABORT)
"Terminal Top Level to ~A" HOST)
(LOOP DOING
(UNLESS (SEND *TERMINAL-SCREEN* :LISTEN)
(SEND TYPEIN-FILTERS :FORCE-OUTPUT))
(DW:WITH-PRESENTATION-INPUT-CONTEXT
('SI:INPUT-EDITOR :STREAM *TERMINAL-SCREEN*) (BLIP)
(LET ((CHAR (READ-CHARACTER *TERMINAL-SCREEN*
:FRESH-LINE NIL
:ANY-TYI T
:NOTIFICATION NIL :REFRESH NIL
:SUSPEND NIL :ABORT NIL
:PRESENTATION-CONTEXT T)))
(WHEN (CL:TYPECASE CHAR
(CHARACTER T)
(CONS (KEYWORDP (CAR CHAR))))
(when (and (characterp CHAR)
(boundp *meta-sends-escape-in-telnet*)
*meta-sends-escape-in-telnet*
(= (logand char-meta-bit (char-bits char)) 1; Char-meta-bit is set
2 char-meta-bit))
(send typein-filters :tyo #\escape)) 1; Send an #\escape first
2 (SEND TYPEIN-FILTERS :TYO CHAR)))
(SI:INPUT-EDITOR
(LOOP FOR CH BEING THE ARRAY-ELEMENTS
OF (DW:PRESENTATION-BLIP-OBJECT BLIP)
DO
(SEND TYPEIN-FILTERS :TYO CH))))))
(WHEN NETWORK-STREAM
(SEND SELF :DISCONNECT)))
((CONNECTION-CLOSED END-OF-FILE)
(FORMAT NIL "Connection closed by ~A." HOST))
(ERROR ERROR)))))
(COND ((EQ REASON :DESELECT)
(SEND SELF :DESELECT)
(PROCESS-DISABLE TYPEIN-PROCESS)
(PROCESS-ALLOW-SCHEDULE))
(REASON
(SEND TERMINAL-IO :EXPOSE-FOR-TYPEOUT)
(FORMAT T "~%~A~%" REASON))))))))