3 \ Requires an ANSI compatible terminal.
5 \ To get Windows computers to use ANSI mode in their DOS windows,
6 \ Add this line to "C:\CONFIG.SYS" then reboot.
8 \ device=c:\windows\command\ansi.sys
11 \ Copyright 1988 Phil Burk
12 \ Revised 2001 for pForth
17 $ 08 constant ASCII_BACKSPACE
18 $ 7F constant ASCII_DELETE
19 $ 1B constant ASCII_ESCAPE
20 $ 01 constant ASCII_CTRL_A
21 $ 05 constant ASCII_CTRL_E
22 $ 18 constant ASCII_CTRL_X
24 \ ANSI arrow key sequences
30 \ ANSI terminal control
31 \ ESC [ 2J is clear screen
32 \ ESC [ {n} D is move left
33 \ ESC [ {n} C is move right
34 \ ESC [ K is erase to end of line
36 : ESC[ ( send ESCAPE and [ )
41 : CLS ( -- , clear screen )
45 : TIO.BACKWARDS ( n -- , move cursor backwards )
53 : TIO.FORWARDS ( n -- , move cursor forwards )
61 : TIO.ERASE.EOL ( -- , erase to the end of the line )
66 : BELL ( -- , ring the terminal bell )
70 : BACKSPACE ( -- , backspace action )
76 : SHOWKEYS ( -- , show keys pressed in hex )
85 : AZ ascii z 1+ ascii a DO i emit LOOP ;