GlassTTY:
CEDAR
PROGRAM
IMPORTS DisplayControllers, IOClasses, Process
= {OPEN DisplayControllers;
glassTTY: ControlProgram;
DefineGlassTTY:
PROC = {
glassTTY ← NewControlProgram[];
AddInstruction[glassTTY, LIST["\015"], cr];
AddInstruction[glassTTY, LIST["\012"], lf];
AddInstruction[glassTTY, LIST["\010"], bs];
};
crlf: Action ← [CRLF];
CRLF:
PROC [dc: DisplayController, clientData:
REF
ANY] =
{dc.cd.class.CursorMove[dc.cd, dc.cd.line+1, 0, FALSE]};
cr: Action ← [CR];
CR:
PROC [dc: DisplayController, clientData:
REF
ANY] =
{dc.cd.class.CursorMove[dc.cd, dc.cd.line, 0, FALSE]};
lf: Action ← [LF];
LF:
PROC [dc: DisplayController, clientData:
REF
ANY] =
{dc.cd.class.CursorMove[dc.cd, 1, 0, TRUE]};
bs: Action ← [BS];
BS:
PROC [dc: DisplayController, clientData:
REF
ANY] =
{dc.cd.class.CursorMove[dc.cd, 0, -1, TRUE]};
ToSelf: PROC [dc: DisplayController] = TRUSTED {Process.Detach[FORK IOClasses.Copy[from: dc.fromDisplay, to: dc.toDisplay, closeFrom: FALSE, closeTo: FALSE]]};
}.