tgetstr/tputs - Text attributes not behaving as documented in termcap

tgetstr/tputs - Text attributes not behaving as documented in termcap

Post by Eskandar Ensa » Fri, 14 Oct 1994 07:46:56



Hello

The following modes in `termcap(5)' do not seem to be behaving as documented:

se    str          End standout mode
ue    str          End underscore mode

Instead, they are behaving as if the following mode is being set:

me    str          Turn off all attributes

I am setting the terminal attributes using tgetstr/tputs in a C program
running under NEXTSTEP 3.1 on a VT100 terminal emulator.  I can correctly
turn ON text attributes (so='Begin standout', 'us='Begin underscore', etc.),
but I am unable to turn individual attributes OFF without disrupting other
text attributes.

While 'se' should end standout mode, it turns off all attributes (just like
'me' is supposed to do).  The same is true of 'ue', which not only turns off
underlining but all other attributes too!

Below are my termcap entries for vt100 and xterm.  I am experiencing the
same problem on both terminal types, and it seems that the character
sequences generated by 'me' are identical to those generated by 'se' and
'ue'.  All three produce the string "ESC-[-m", which turns all attributes
off.  Is this appropriate behavior for vt100-compatible terminals?

d0|vt100|vt100-am|vt100am:do=^J:co#80:li#45:cl=\E[;H\E[2J:sf=2*\ED:le=^H:bs:am:cm=5\E[%i%d;%dH:nd=2\E[C:up=2\E[A:ce=3\E[K:cd=50\E[J:so=2\E[7m:se=2\E[m:us=2\E[4m:ue=2\E[m:md=2\E[1m:mr=2\E[7m:mb=2\E[5m:me=2\E[m:is=\E[1;24r:rf=/usr/lib/tabset/vt100:rs=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:ks=\E[?1h\E=:ke=\E[?1l\E>:ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=^H:ho=\E[H:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:pt:sr=2*\EM:vt#3:xn:sc=\E7:rc=\E8:cs=\E[%i%d;%dr:

vt|xterm|vs100|4315x:cr=^M:do=^J:nl=^J:bl=^G:le=^H:ho=\E[H:co#80:li#45:cl=\E[H\E[2J:bs:am:xn:cm=\E[%i%d;%dH:nd=\E[C:up=\E[A:ce=\E[K:cd=\E[J:so=\E[7m:se=\E[m:us=\E[4m:ue=\E[m:md=\E[1m:mr=\E[7m:me=\E[m:ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=^H:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:ta=^I:pt:sf=\n:sr=\EM:al=\E[L: ;4;6l:ti=\E7\E[?47h:te=\E[?47l\E8:hs:ts=\E[?E\E[?%i%dT:fs=\E[?F:es:ds=\E[?E:CV=\E[%i%oH:DC=\E[%dP

Thanks in advance!  If you can, please e-mail me a copy of your response.

- Eskandar

--
KiNDa LiKe a DoG WiTH SeVeN PuPiLS iN iTS eYe                L E F T   H A N D
KiNDa LiKe a MaDNeSS THaT ReFuSeS To SuBSiDe                   B  L  A  C  K
KiNDa LiKe eVeRYTHiNG You WaNT JuST WiTHiN YouR GRaSP           - - - - - -
KiNDa LiKe HoW a BaNSHee-WaiL DaNCeS oN a LiViNG HeaRT...       D a n z i g

 
 
 

tgetstr/tputs - Text attributes not behaving as documented in termcap

Post by joh.. » Tue, 18 Oct 1994 23:29:04



    (Eskandar Ensafi) writes:

Quote:> Hello

> The following modes in `termcap(5)' do not seem to be behaving as documented:

> se    str          End standout mode
> ue    str          End underscore mode

> Instead, they are behaving as if the following mode is being set:

> me    str          Turn off all attributes

> I am setting the terminal attributes using tgetstr/tputs in a C program
> running under NEXTSTEP 3.1 on a VT100 terminal emulator.  I can correctly
> turn ON text attributes (so='Begin standout', 'us='Begin underscore', etc.),
> but I am unable to turn individual attributes OFF without disrupting other
> text attributes.

On the VT100, the only escape sequence available is the one which turns off
all attributes (i.e. ESC[0m).
The VT220 introduced a new set of escape sequences to turn off individual
attributes as follows:
ESC[22m   Bold off
ESC[24m   Underline off
ESC[25m   Blinking off
ESC[27m   Reverse Video off
These are available on vt220 and upwardly-compatible terminals. A vt100
emulator should ignore these sequences.

- Show quoted text -

Quote:

> Thanks in advance!  If you can, please e-mail me a copy of your response.

> - Eskandar


 
 
 

1. I GIVE UP: tput: usage: "tput [-Tterm] capname"

To all:

tput worked great on one system, a DG/UX box where I used the syntax:

tput cup 10 10

to provide absolute cursor addressing to row 10 col 10 on the screen
in a shell script.  Cool.  But now I'm using an RS6000, and an HP9000
and they both die using this command, giving me the cryptic message:

tput: usage: "tput [-Tterm] capname"

Before you offer solutions, I've tried:

$TERMCAP: /etc/termcap   $TERM:vt100

1. Purchase O'reilly book on termcap & terminfo

   Interesting book, but few examples.  Posted to this newsgroup
   per the advice of the book.

2. Perused ATT System V Programmer's Reference Manual through the
   terminfo section, and hacked tput commands to see how they worked
   with the vt100 termcap.  This ancient guide has a nice long
   dissertation on terminfo et al, but still no examples to tell me
   what to do.

3. Tried:
   tput init
   tput -Tvt100 init
   tput -Tvt100 cup 10 10
   and many other variations on this theme.  

4. Puttered with the neat little "listcap" script, and hacked around
   some more.

There's got to be some kind of answer to this, but I'm clueless.  This
is one thing about UNIX I can really hate--the documentation.  Give me
an example and I can move the world.

Tim
                                     \\|//
                                     (6 9)
==============================---o00--(_)--00o---============================
Tim Schaefer   (800)587-9502                   http://www.gate.net/~tschaefe

               Earn Big Money for your Alien Childbirth Photos!
=============================================================================

2. DNS Question

3. Visio DWG export does not transport all text attributes and linestyles

4. HUMOR: Top 5 reasons to choose WindowsNT over the others...

5. Can not add operation /attribute to Class diagram, nor text to message call

6. Install Disk 1 hang on IBM1S506.ADD - solution found!

7. using special chars in Text Attribute of Static Text-Design mode

8. PC wont connect to iPaq with serial port

9. Text not found in some PDF documents, Found in others - Why?

10. Pic not behaving as expected

11. Semaphores not behaving

12. Acrobat document security and plug-ins in general

13. Search and replace not behaving