Mail Archives: djgpp/2002/12/10/00:58:16
On Mon, 9 Dec 2002, CBFalconer wrote:
> > I don't think there is a work-around, sorry. Any DOS program that
> > accesses the video memory directly will cause this unpleasant
> > side-effect. I consider this a misfeature of the NT family of
> > Windows.
>
> How does ls write to video? All it's output should be to stdout.
ls uses direct video writes to support the --color command-line option.
The reason it uses direct video access is that I didn't want to rely on
ANSI.SYS to be present.
The code in ls indeed writes to stdout, but the ported program uses the
DJGPP's Filesystem Extension feature to intercept those writes just
before they are sent to the DOS WriteFile function, and use conio
functions instead. (This is only done when colored output was requested
by the user.)
- Raw text -