1 # console output for DCT, by Shiar
3 # 1.11.0 200410152225 - class in file name, so check is not needed anymore
4 # 1.10.1 200410142200 - startup message omitted (now shown by main)
5 # 1.10.0 200410140120 - never clear screen (just let it scroll)
6 # - try to get width/height from environment vars
7 # - use escape sequences for clear/reposition/invert
8 # - print everything to STDOUT
13 #return 0 if $set{display};
14 #$set{display} = "stdout";
16 push @{$hook{init}}, sub {
17 # print "\ec"; # reset (clear screen, go home)
18 # print "\e[4mDCT $::VERSION\e[24m "; # print intro (underlined)
21 $set{height} = $ENV{LINES}-2 if $ENV{LINES} and $ENV{LINES}>=3;
22 $set{width} = $ENV{COLUMNS} if $ENV{COLUMNS};
25 push @{$hook{showerror}}, sub {
26 print "\n\a\e[7m$_[0]\e[27m"; # bell and reverse video
29 push @{$hook{showstack}}, sub {
30 for (reverse 0..@stack-1) {
31 print "\n$_: ", showval($stack[$_], $set{base});
33 print "\n> "; # prompt
36 push @{$hook{showentry}}, sub {
37 print "\e[3G\e[K", $_[0]; # cursor to column #3; erase line
42 title => "console output",