The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: bqt@update.uu.se (Johnny Billquist)
Subject: [TUHS] I swear! I rtfm'ed
Date: Thu, 01 Jan 2015 00:52:42 +0100	[thread overview]
Message-ID: <54A48C4A.90307@update.uu.se> (raw)
In-Reply-To: <mailman.116.1420056874.3354.tuhs@minnie.tuhs.org>

On 2014-12-31 21:14, Clem Cole<clemc at ccc.com> wrote:
>
> Jake - you have lots of help from others and using curses(3) is definitely
> the right way to program.
>
> But to answer your specific question about printf(string), according to
> Chapter 3 (Programmer's Info) of my old VT-100 user's guide, I think what
> is you are doing wrong is that "\033c" is not the ANSI clear to end of
> screen command.

Right...

> When I saw your message on my iPhone last night, the cache said - wait that
> can't be correct.   But I could not remember why.   So I had to wait until
> I got back home today to look in my basement.
>
> As I suspected, it's not an ANSI sequence.  So are you running in VT-100
> (ANSI) mode or VT52 mode?  I ask because it is close to the VT52 cursor
> right command which is actually:  "\033C"  but I do not remember is case
> mattered.

Case do matter.

> In VT52 mode you need to send the terminal:  "\033H\033J" to clear the
> screen.
>
> In ANSI mode, it becomes:  "\033[1;1\033[0J"

Shorter form: "\033[H\033[J"

> A few things to remember:
> 1.) Clear takes the current cursor position and clears from there to end of
> X (where X depends on mode, and type of clear).  So you need to move the
> cursor to home position (aka 1,1).

Not really. It's way more advanced than that.

If we start with the generic clear screen, it is CSI Pn J

Where CSI can be expressed as ESC [ (or "\033[" in the same parlance as 
above.)

Pn, then is an argument to the function, while J is the actual function 
(clear screen in this case).

Now, Pn can cause many things:

0	Clear from cursor to end of screen
1	Clear from cursor to end of screen
2	Clear from beginning of screen to cursor
3	Clear whole screen

If no argument is given, the default is 0.

> 2.) VT-100's did not implement the full ANSI spec like Ann Arbor, Heathkit,
> Wyse etc.  So there are a number of things that those terminals did
> better.  A really good reason to you curses(3) because all the knowledge is
> keep in the termcap and as a programmer you don't need to worry about it.

Probably true. However, I'm not sure Ann Arbor or Heathkit did much 
better. As far as I can remember, they were always more "weird", but I 
might just be confused. However, curses(3) is definitely a good way of 
not having to care about different terminal oddities.

> 3.) I saw sites were VT52 mode was sometimes preferred because it was good
> enough for most editing, and needed fewer chars to do manipulation.  On
> slow serial lines, this sometimes was helpful.  That said, give me an AAA
> any day.  Like others, I still miss that terminal.:-)

Yeah, the VT52 was simpler, and had shorter control strings. But of 
course, with the additional limitations that came with that.

Personally, I'd give an AAA or a Heathkit away if one was dropped on me. 
A VT100 I would keep. :-)

	Johnny

-- 
Johnny Billquist                  || "I'm on a bus
                                   ||  on a psychedelic trip
email: bqt at softjar.se             ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol



       reply	other threads:[~2014-12-31 23:52 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.116.1420056874.3354.tuhs@minnie.tuhs.org>
2014-12-31 23:52 ` Johnny Billquist [this message]
2015-01-01  1:29   ` Erik E. Fair
2015-01-01 15:03     ` Johnny Billquist
2015-01-01 15:59       ` Mary Ann Horton
2015-01-01 20:18         ` Dave Horsfall
2015-01-01 20:11       ` Dave Horsfall
2015-01-01 16:01   ` Clem Cole
2015-01-01 16:11     ` Johnny Billquist
2015-01-01 16:59       ` Clem Cole
2014-12-31 16:25 Noel Chiappa
     [not found] <mailman.110.1420006566.3354.tuhs@minnie.tuhs.org>
2014-12-31 10:37 ` Johnny Billquist
2014-12-31 11:13   ` arnold
  -- strict thread matches above, loose matches on Subject: below --
2014-12-30 22:56 Jacob Ritorto
2014-12-30 22:59 ` Milo Velimirovic
2014-12-30 23:03 ` Larry McVoy
2014-12-31  0:03   ` Steve Nickolas
2014-12-30 23:05 ` Warren Toomey
2014-12-31  0:01   ` Jacob Ritorto
2014-12-31  2:22     ` Dan Stromberg
2014-12-31  2:33       ` Mary Ann Horton
2014-12-31  5:44         ` Jacob Ritorto
2014-12-31  6:24   ` Dave Horsfall
2014-12-31  6:36     ` Lyndon Nerenberg
2014-12-31 14:58       ` Tim Bradshaw
2014-12-31 15:31         ` arnold
2014-12-31 15:37           ` Milo Velimirovic
2014-12-31 17:37             ` Derrik Walker v2.0
2014-12-31 20:09               ` Larry McVoy
2014-12-31 22:25                 ` Jacob Ritorto
2014-12-31 16:11       ` Mary Ann Horton
2014-12-31 20:14 ` Clem Cole
2014-12-31 20:45   ` Erik E. Fair
2014-12-31 21:05     ` Clem Cole
2014-12-31 22:30       ` Jacob Ritorto
2014-12-31 23:06         ` Mary Ann Horton
2014-12-31 23:11           ` Jacob Ritorto
2015-01-01 15:45         ` Clem Cole

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54A48C4A.90307@update.uu.se \
    --to=bqt@update.uu.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).