[chuck-users] VT100 emulation

Hans Aberg haberg at math.su.se
Sun May 3 07:50:52 EDT 2009


It is quite easy to write to terminal in xy-coordinate layouts - one  
uses the VT100 escape sequences. I attach an example with a class with  
some such layout functions (which also contains links to VT100 specs).  
It should write some text in different colors and positions.

There are some problems though:

1. One should have a commands that can write a file as is, without  
additions.
Currently "<<<...>>>" writes type when having only item, a space  
between items, and a newline.

2. One can use commands like echo off and keyboard lock, which would  
good when playing the typing keyboard and for not littering the  
terminal display, but then there is no way to reset that when exiting  
using an interrupt. This could be fixed by allowing users to write  
their own function exit() which is called upon an exit or kill signal.

3. For some reason, the echo off escape sequence does not work on my  
Terminal. One can get around it by using 'Std.system("stty -echo")',  
but then 'Std.system' must be enabled (it seems) using startup option  
'--caution-to-the-wind'.

And this may not be portable if somebody is using an un-Posix  
computer. So a function echo() might be useful.

   Hans

-------------- next part --------------
A non-text attachment was scrubbed...
Name: terminal.ck
Type: application/octet-stream
Size: 3721 bytes
Desc: not available
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20090503/9ef447e3/attachment.obj>
-------------- next part --------------






More information about the chuck-users mailing list