delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/11/25/13:15:56

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Improved dos bos for bash with scollable window ???
Date: 25 Nov 2003 18:05:36 GMT
Organization: Aachen University of Technology (RWTH)
Lines: 42
Message-ID: <bq05lg$91r$1@nets3.rz.RWTH-Aachen.DE>
References: <25a1dc7c DOT 0311240930 DOT 79217c02 AT posting DOT google DOT com> <bpvds5$944$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE> <7b68d58f DOT 0311250740 DOT 5a38c106 AT posting DOT google DOT com>
NNTP-Posting-Host: ac3b07.physik.rwth-aachen.de
X-Trace: nets3.rz.RWTH-Aachen.DE 1069783536 9275 137.226.33.205 (25 Nov 2003 18:05:36 GMT)
X-Complaints-To: abuse AT rwth-aachen DOT de
NNTP-Posting-Date: 25 Nov 2003 18:05:36 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Tom <Thomas8675309 AT yahoo DOT com> wrote:

> I'm confused.  What do you mean by "back-scrollable" and "MS-DOS
> program that outputs to the screen"?  On my Windows XP system, using
> cmd.exe as my shell, I have the ability to scroll back to the
> beginning of the session using the scroll bar, and that includes when
> I run my DJGPP-compiled programs (which output to the screen using
> std::cout and printf).  

Right. But it'll continue to work that way only as long as the program
restricts itself to that kinds of functions for its output.  Try
DJGPP's ls for a change, esp.  if you run it like this:

	ls -l --colour=auto

The moment you do that, the scrollbar will be gone, or at the very
least the back buffer will be empty.

The root of this all is that DOS programs have a wildly different idea
of how to control the screen compared to what Unix programs use.  If a
Unix program wants to do something fancy (i.e. anything beyond what a
normal printf() can do) with the terminal, it tells the terminal what
it wants by outputting terminal control sequences intermixed with its
other output.  DOS programs _can_ operate that way, too, in principle,
by using the ANSI.SYS driver.  But such programs are very rare.

Your typical DOS program facing the need to e.g. control the cursor or
display colours will typically do so by bypassing DOS completely and
instead write directly into the videocard's memory, or at least resort
to BIOS calls.  That kind of activity doesn't leave a trace that the
XP console window or any other hypothetical xterm-alike could
reasonably record and replay once you start scrolling around.  To even
allow the program to hack the screen this way in spite of XP being a
protected OS, the console window has to switch itself into a legacy
compability mode, in which it acts as a virtual VGA card, with
simulated frame buffers for the app to poke around in, and a simulated
BIOS it can call.  This mode of operation is fundamentally
incompatible with the concept of a scrollable terminal window.

-- 
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019