zsh-users
 help / color / mirror / code / Atom feed
From: Kurtis Rader <krader@skepticism.us>
To: Ray Andrews <rayandrews@eastlink.ca>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: print color escapes
Date: Thu, 1 Jan 2015 17:21:10 -0800	[thread overview]
Message-ID: <CABx2=D9exfP5eqTAFrx8x8wLuRPQ6e5sLz6bdi1RTjXc1htzXQ@mail.gmail.com> (raw)
In-Reply-To: <54A5D21F.1090701@eastlink.ca>

[-- Attachment #1: Type: text/plain, Size: 1921 bytes --]

On Thu, Jan 1, 2015 at 3:02 PM, Ray Andrews <rayandrews@eastlink.ca> wrote:

But terminal will always grab ESC 'hard' will it not?  That is to say that
no matter how you dress it up, the terminal always sees it verbatim.  And
I'd expect that that convention is now written in stone.


The terminal always sees every character verbatim. How it treats the
character depends on many things. In the past (circa the 1980s) you could
purchase "smart" terminals from different companies each of which
implemented their own "language". Language in this context means the
 specific mapping of character sequences to actions such as clearing the
screen or changing the foreground color. The reason the terminfo and
termcap databases and associated programming APIs exist (try typing "man
terminfo" or "man tercap" at your shell prompt) was to make it possible for
programs to perform actions like moving the cursor to a specific location
on the screen without explicitly knowing which control language the
terminal implemented.

One of those was the DEC VT100. The "language" it recognized eventually
became the winner. Winner in the sense that by the 1990s nearly all
terminals implemented that language. That de-facto standard was eventually
turned into standard ANSI X3.64
<http://en.wikipedia.org/wiki/ANSI_escape_code> which is now pretty much
the only terminal control language you'll find in use.

P.S., Yes, I've glossed over many important details above. Such as the fact
the DEC VT52 was actually the first terminal to implement what would
eventually become the ANSI X3.64 standard. But it was the VT100 that made
that transition all but inevitable. Today things are even more complicated
by Unicode and encodings such as UTF-8 which a terminal should understand
in order to translate multi-byte characters into the appropriate human
language glyph.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank

  parent reply	other threads:[~2015-01-02  1:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-01  5:47 Ray Andrews
2015-01-01  6:35 ` Bart Schaefer
2015-01-01 19:24   ` Ray Andrews
2015-01-01 21:29     ` Bart Schaefer
2015-01-01 23:02       ` Ray Andrews
2015-01-01 23:26         ` Bart Schaefer
2015-01-02  2:30           ` Ray Andrews
2015-01-02  2:45             ` Kurtis Rader
2015-01-02  3:50               ` Ray Andrews
2015-01-02  4:18                 ` Bart Schaefer
2015-01-02 17:43                   ` Ray Andrews
2015-01-02  1:21         ` Kurtis Rader [this message]
2015-01-02  2:39           ` Ray Andrews
2015-01-02  2:58             ` Kurtis Rader
2015-01-02  3:48               ` Ray Andrews

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='CABx2=D9exfP5eqTAFrx8x8wLuRPQ6e5sLz6bdi1RTjXc1htzXQ@mail.gmail.com' \
    --to=krader@skepticism.us \
    --cc=rayandrews@eastlink.ca \
    --cc=zsh-users@zsh.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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).