An OCaml curses editor to write coloured texts or draw things.


A cursico session


bold, underlined and blink attributes are available

Needs :
libcurses-ocaml :

ocamlmakefile :

On debian,  just type make.
Otherwise, please edit Makefile to provide a valid ocamlmakefile path.

./cursico -help
shows options

When no file name is provided, default.esc is used.

./cursico file.esc
If file exists, read file.esc and adapt palette to used atributes.
If not, create file.esc using default size and a  palette without attributes.

./cursico -d 40x3 file.esc
Use an editing window of specified size : 3 lines of 40 chars.
If file exists, read file and adapt palette to used atributes.
  The window size possibly truncates file.
If not, create file.esc using a palette without attributes.

./cursico -b -k file.esc
Use a palette with 'bold' and 'blink' attributes.
However if file.esc uses 'underline' attribute, it is added to the former attributes.

Tab toggle focus between palette and drawing windows.
Arrows / Home/ End move inside the palette or inside the drawing area.
('Enter' can be used from palette to.)
F1 locks the palette foreground, background and attributes.
F9 quit without saving.
F10 saves and quit.

The stored file format is only a subset of ansi escaped chars.
So the program will not be able to parse any escaped sequences.
It stores (and of course can read) things using this format, taking carriage returns (CR) into account :

((esc '[' (attribute_digit ';')* '3' foreground_digit ';' '4' background_digit 'm'
esc "[0m")* CR)*

It can also read normal (= non escaped) text files :
((^esc)* CR)*

A remark about the source code : it is pretty imperative and a poor model of functional programming. (Doesn't care : the aim to fulfill was editing efficiently coloured text.)