ansi graphic

ansi graphic

Post by Daniel Hob » Fri, 28 Jun 2002 19:58:16



hi folks,

Is there any viewer or something to view "ansi graphics". If i set
term=ansi, i get the colors right but not the various form symbols,
which make the graphic look pretty. i'm particulary interested in a way
to display these graphic in a terminal and not a X11 program.

my os is solaris 2.8, but i guess thats not relevant.

many thanks and greets
Daniel

 
 
 

ansi graphic

Post by Yuan Li » Sat, 29 Jun 2002 14:28:32



> hi folks,

> Is there any viewer or something to view "ansi graphics". If i set
> term=ansi, i get the colors right but not the various form symbols,
> which make the graphic look pretty. i'm particulary interested in a way
> to display these graphic in a terminal and not a X11 program.

> my os is solaris 2.8, but i guess thats not relevant.

> many thanks and greets
> Daniel

You may want to search for a termcap that has the right ansi entry.

I remember someone once gave me one and all the form symbols showed.

No longer have it. (You can create one if you have the time.)

Yuan Liu

 
 
 

ansi graphic

Post by Thomas Dicke » Sun, 30 Jun 2002 00:40:49



> hi folks,
> Is there any viewer or something to view "ansi graphics". If i set
> term=ansi, i get the colors right but not the various form symbols,
> which make the graphic look pretty. i'm particulary interested in a way
> to display these graphic in a terminal and not a X11 program.
> my os is solaris 2.8, but i guess thats not relevant.

but what is relevant is the terminfo entry you're using, relative to
the terminal (neither is stated here).

--

http://dickey.his.com
ftp://dickey.his.com

 
 
 

ansi graphic

Post by Daniel Hob » Sun, 30 Jun 2002 21:01:36




> > hi folks,

> > Is there any viewer or something to view "ansi graphics". If i set
> > term=ansi, i get the colors right but not the various form symbols,
> > which make the graphic look pretty. i'm particulary interested in a way
> > to display these graphic in a terminal and not a X11 program.

> > my os is solaris 2.8, but i guess thats not relevant.

> but what is relevant is the terminfo entry you're using, relative to
> the terminal (neither is stated here).

Sorry, i'm quite new to these things. The shell i'm using is tcsh (is
that the terminal?), and isn't the terminfo entry set to ansi with "set
term=ansi".

Or is there an easy way to find out what terminal/terminfo entry i'm
using?

many thanks and regards
Daniel

 
 
 

ansi graphic

Post by Thomas Dicke » Sun, 30 Jun 2002 21:37:27





>> > hi folks,

>> > Is there any viewer or something to view "ansi graphics". If i set
>> > term=ansi, i get the colors right but not the various form symbols,
>> > which make the graphic look pretty. i'm particulary interested in a way
>> > to display these graphic in a terminal and not a X11 program.

>> > my os is solaris 2.8, but i guess thats not relevant.

>> but what is relevant is the terminfo entry you're using, relative to
>> the terminal (neither is stated here).
> Sorry, i'm quite new to these things. The shell i'm using is tcsh (is
> that the terminal?), and isn't the terminfo entry set to ansi with "set
> term=ansi".
> Or is there an easy way to find out what terminal/terminfo entry i'm
> using?

The terminfo entry is specified with the $TERM environment variable.

Solaris (using CDE) has a program usually named "Terminal", which is dtterm.
xterm is also available, but usually not accessible from the menus.  It's
not likely that you're running OpenLook (I don't know if it's available on
Solaris 8 - it is in Solaris 7).  The terminal emulator in OpenLook isn't
ansi in any case (doesn't do color).  If you're getting color, but not
knowing much about what terminal emulator you're using, that's probably
dtterm.

Using infocmp to show the differences between $TERM set to 'ansi' vs 'dtterm'
depends on whether you're using ncurses' terminfo or Sun's.  I see that
Sun's ansi terminfo entry has no color

comparing ansi to dtterm.
    comparing booleans.
        mir: F:T.
        msgr: F:T.
        xenl: F:T.
    comparing numbers.
        colors: -1:8.                <---
        it: -1:8.
        lm: -1:0.
        pairs: -1:8.                 <---
    comparing strings.
        acsc: 'NULL','``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~'.
        cbt: '\E[Z','NULL'.
        civis: 'NULL','\E[?25l'.
        cnorm: 'NULL','\E[?25h'.
(rest omitted)

While ncurses shows this (bear in mind that infocmp displays only differences
here, and the dtterm entry is almost identical):

comparing ansi to dtterm.
    comparing booleans.
        mc5i: T:F.
        xenl: F:T.
        xon: F:T.
    comparing numbers.
        lm: NULL, 0.
        ncv: 3, NULL.
    comparing strings.
        acsc: '+\020\,\021-\030.^Y0\333`\004a\261f\370g\361h\260j\331k\277l\332m\300n\305o~p\304q\304r\304s_t\303u\264v\301w\302x\263y\363z\362{\343|\330}\234~\376', '``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~'.

The acsc string, you will notice is different between the two ansi entries,
and in neither case does it match dtterm.

--

http://dickey.his.com
ftp://dickey.his.com

 
 
 

ansi graphic

Post by Steve Madin » Mon, 01 Jul 2002 04:28:12


:>

:> > hi folks,
:>
:> > Is there any viewer or something to view "ansi graphics". If i set
:> > term=ansi, i get the colors right but not the various form symbols,
:> > which make the graphic look pretty. i'm particulary interested in a way
:> > to display these graphic in a terminal and not a X11 program.
:>
:> > my os is solaris 2.8, but i guess thats not relevant.
:>
:> but what is relevant is the terminfo entry you're using, relative to
:> the terminal (neither is stated here).

: Sorry, i'm quite new to these things. The shell i'm using is tcsh (is
: that the terminal?), and isn't the terminfo entry set to ansi with "set
: term=ansi".

The problem is that the terminfo setting (the $TERM variable, as
another poster described) is meant to communicate to the system
what kind of terminal (or terminal emulator) you are using, so
programs know how to do stuff on your screen.  Setting the
$TERM to "ansi" doesn't magickly turn your terminal into an
ansi terminal.  It tells the programs to send your terminal the
appropriate codes for an ansi terminal.  If your terminal isn't
really an ansi terminal and can't really do ansi characters, then
it still won't work - you are essentially lying to the programs,
telling them "Hi, I'm on an ansi terminal" when in reality you
aren't, and the ansi codes don't work right.

What you need is twofold:

  1 - You need a program that can emulate an ansi terminal, and
  it needs to be in "ansi" mode.  (I don't know which ones
  can do it.)
  2 - You need to communicate to unix programs that you are
  on an ansi terminal by setting the $TERM variable to "ansi".

It sounds like you are doing #2, but not #1.

Oh, one other note - the tcsh shell is annoying in that it "helps"
people by mapping some internal variables to environment variables
so as to make things confusing.  When you say "set term=ansi" that
has a hidden effect.  Not only does it set a local C-shell variable
called "term" to "ansi", it ALSO does a "setenv TERM ansi" without
telling you.  It does something similar with a few other variables,
but not all of them (which is what turns it into a confusing rather
than helpful feature - you have to memorize which variables are
mapped thusly.)  The bourne-derived shells (like bash) are much
simpler in that they simply don't bother with local variables
like C-shell does - all variables are environment variables in
bash.  But you can choose which get exported to other programs
and which don't, which in a way is like having some of them
local if you want.

The other annoying thing about tcsh is that a lot of its
good string-manipulation features for use on variables work
ONLY on the local C-shell variables, not on environment
variables.  Since the bourne-derived shells use environment
variables for everything, their string manipulation routines
can be used to set environment variables.

The c-shell method of having internal variables is faster,
because accessing the environment is not a fast operation, but
if you are talking about shell programming, then the speed
difference is irrelevant anyway - most of the time spent in
a shell script is spent waiting for the commands you run, like
grep, ls, and so on.

In general, if you can, wean yourself from the c-shell at an
early age.  It's okay for interactive stuff, but once you try
to write a script with it it's awful.  So you might as well
get used to the Bourne syntax right away so if you move to
writing scripts later it isn't a painful thing to learn.  It's
a bit like learning to drive, in that even if you are in an
automatic transmission car, you are still told to not use your
left foot on the brake, and instead swap your right foot between
acellerator and brake.  That's so that if you make the move to
a manual transmission later, you don't have to unlearn your
habits.  (And it also has the nifty effect of preventing you
from pressing both the accellerator and the brake at the same
time, which there's never any good reason to do.)

 
 
 

ansi graphic

Post by Yuan Li » Mon, 01 Jul 2002 15:28:29


[snip]

Quote:> mapped thusly.)  The bourne-derived shells (like bash) are much
> simpler in that they simply don't bother with local variables
> like C-shell does - all variables are environment variables in
> bash.  But you can choose which get exported to other programs
> and which don't, which in a way is like having some of them
> local if you want.

If a variable is not seen by child processes, why is it is local only "in a way"?  Just curious. (I thought export made them global - or environmental.)

Yuan Liu

[snip]

 
 
 

ansi graphic

Post by Cameron Simpso » Mon, 01 Jul 2002 16:23:11



| >mapped thusly.)  The bourne-derived shells (like bash) are much
| >simpler in that they simply don't bother with local variables
| >like C-shell does - all variables are environment variables in
| >bash.  But you can choose which get exported to other programs
| >and which don't, which in a way is like having some of them
| >local if you want.
|
| If a variable is not seen by child processes, why is it is local only "in a
| way"?  Just curious. (I thought export made them global - or environmental.)

An exported variable is global in that all children get a copy. It's not
global in that the inheritance is strictly parent to child: if the child
makes a change the parent never sees it, because the child has a copy.

An unexported variable is local to the process - it is not exported to
the child processes. However, generally Bourne shells don't do any more
scoping by default - a variable is global to that shell.

Korn shells and their derivatives will do "local" variables - local to
a shell function AFAIR - with the type command, used to mark things as
numbers or arrays etc. I never really liked it much and don't use it.

I got spoilt with another Bourne shell which just did locals using
the same syntax as per-command variables:

        foo=one
        foo=bah {
                stuff using local $foo, set as "bah" etc
        }
        $foo is "one" again now

Seemed cleaner to me.
--



WG> Let's say there are no Yamaha's or Kawa's in the world.

SR> sriw - so then you are saying that Revelations (from the Bible) has come
SR> true and Hell is now on Earth.
WG> Your choice for you new bike is either a new '98 fuel injected SRAD, or a
WG> new '98 Fireblade.
SR> sriw -The devil's minions - full of temptation but never fulfilling their
SR> promise.

 
 
 

ansi graphic

Post by Steve Madin » Wed, 03 Jul 2002 20:28:06


: [snip]

:> mapped thusly.)  The bourne-derived shells (like bash) are much
:> simpler in that they simply don't bother with local variables
:> like C-shell does - all variables are environment variables in
:> bash.  But you can choose which get exported to other programs
:> and which don't, which in a way is like having some of them
:> local if you want.

: If a variable is not seen by child processes, why is it is local only "in a way"?  Just curious. (I thought export made them global - or environmental.)

Every process in unix has an environment attached to it which is
essentially a large associative array (mapping names to values).
There is one per process.  When a child is spawned by a parent,
initial settings for environment variables can be given by the
parent program.  In sh, ksh, and bash, there is internally
a list of flags for which environment variables will be thusly
copied to children it launches, versus which will not.  Thus
yes, the variables are in the environment for the shell whether
they are exported or not.  The export command simply tells
the system which ones to flag for propigation.

The C shell is different.  The C shell unconditinally exports
all environment variables, and expects users to use its own
internal variable system for things that are not to be exported.

(So what you say is mostly true of C-shell, but not Bourne.)

 
 
 

1. Getting Xterm to understand IBM ANSI graphic characters?

Ok, the color_xterm program (The version of Xterm which was modified to
respond to ANSI color and text changes) works great...  But since I use
Seyon to talk to BBS's which commonly use the graphic characters to do some
fancy graphics like boxes and diagrams on the screen, what I need is either:
  1)  An X font which is similar to the extended character set which IBM and
      Apple Macintoshes expect to contain corners, boxes, cross lines, etc.

  2)  I noticed by doing an "xfd -fn 10x20" that the standard "Fixed" character
      sets have international characters where the ANSI BBS's expect these
      graphic drawing characters.  So my interim solution is to remap specific
      international characters to the graphic characters using XTerm X
      resources, so that when the Xterm window (spawned by Seyon) receives
      these (ranging from ascii decimal 170 to 200 or so) it replaces them
      with numbers down in the 10 to 20 range.
           So does anybody have pre-set character code mapping for any of the
      standard X fonts that makes the international character sets look more
      like the ANSI IBM extended character set?

  3)  I know you can set eightBitOutput false so that 128 is subtracted from
      any incoming character code before being printed, but I don't think
      that is sthe solution because at least for this particular "ANSI" bbs
      I was using to reverse engineer the mappings, they seemed to range fromm
      186 to 196 difference between the character code values, but I could
      have chosen wrong...

  4)  Is there a document on the supported resources for color_xterm?  I have
      no manual page on it.

Thanks!
    Devon Tuck

2. secure ftp

3. BBS ANSI Graphics and telnet?

4. Adding DVD Drive

5. ANSI GRAPHICS

6. GCC-2.8 or EGCS? The Future of FreeBSD's cc(1)?

7. ANSI Graphics & TCSH/BSD

8. RAD on linux ?

9. tcsh with ansi graphics

10. ANSI graphics in Linux

11. SEYON & ANSI-BBS graphics

12. Ansi chracter graphic.

13. SCO ANSI terminal vs. regular ANSI terminal