lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lynx-dev Special handling for TERM=sun


From: John Hawkinson
Subject: lynx-dev Special handling for TERM=sun
Date: Fri, 30 Jul 1999 02:36:35 -0400 (EDT)

[ I am not on lynx-dev, so please cc me on any relevent correspondance ]

Greetings. After being forced to use lynx on a Sun text console
(no X server), the 80x34 black-on-white thing, I produced the following
patch. The problem is that Sun implements both ESC [ 7 m and ESC [ 3 m
as reverse video, though lists one as 'bold' and the other as 'rev' in
terminfo.

This causes the current link in lynx to be indistinguishable from
any other link. Use of -show_cursor and -numbered_links help, but
not adequately.

This patch causes lynx to not highlight or otherwise distinguish the
current link when on a TERM=sun, or its variants (sun*, i.e.

> echo sun*
sun sun-1 sun-12 sun-17 sun-24 sun-34 sun-48 sun-cmd sun-e sun-e-s sun-na 
sun-nic sun-s sun-s-e sun1 sun2 sune

, all of which are minor variants, as can be seen with "infocmp sun*"),
or when the environment variable LYNX_MASK_REVERSE is set.

The rationale behind the environment variable is that if one is on
such a lousy terminal, one is quite likely to run 'screen', which makes
everything appear like a 'vt100'. Nevertheless, one has the same problem.
There's no way to determine what sort of terminal the 'screen' is running
under, nor would such a determination really be appropriate from an
abstraction point of view.


I originally did this for lynx 2.7.1 and ported the patch to 2.8.2rel.1.

To implement this required effect I added a global variable in parallel
with Current_Attr called Masked_Attr. Whenever Current_Attr is used,
it is ANDed with the bitwise NOT of Masked_Attr. So setting Masked_Attr
to A_REVERSE causes A_REVERSE to never be set.

I have tested this under Solaris 2.6 without SLANG. I believe that the patch
should function properly with SLANG, however.

If this patch is somehow unsatisfactory, please let me know and I will
try to amend it.

address@hidden
  John Hawkinson

*** 1.1 1999/07/30 06:21:55
--- CHANGES     1999/07/30 06:28:08
***************
*** 1,6 ****
--- 1,10 ----
  Changes since Lynx 2.8 release
  
===============================================================================
  
+ * Add special handling of TERM=sun and the LYNX_MASK_REVERSE environment
+   variable to account for reverse video lossage on Sun text consoles
+   (John Hawkinson <address@hidden>).
+ 
  1999-06-01 (2.8.2rel.1)
  -----------------------
  1999-06-01 (2.8.2pre.11)
*** 1.1 1999/07/30 06:22:23
--- PROBLEMS    1999/07/30 06:24:37
***************
*** 150,155 ****
--- 150,161 ----
      Alternatively, compiling Lynx with the slang library may avoid problems
      with theses terminals.
  
+     The Sun console driver (aka wscons(7)) implements "reverse" and "bold"
+     as "reverse", causing confusion where Lynx uses the distinction between
+     the two to convey information. Lynx tries to detect this automatically,
+     but if it fails (for instance, you are running under "screen"), try
+     setting the LYNX_MASK_REVERSE environment variable.
+ 
      On VMS, Lynx, and other TCP-IP software, have been experiencing chronic
      problems of incompatibilities between DECC and MultiNet headers whenever
      new versions of either DECC or MultiNet are released.  The Lynx build
*** 1.1 1999/07/30 06:13:34
--- lynx.hlp    1999/07/30 06:19:34
***************
*** 521,526 ****
--- 521,532 ----
                             meaningful if  Lynx  was  built  using
                             experimental color style support.]
  
+        LYNX_MASK_REVERSE   This variable, if set,  causes Lynx to
+                            ignore  any reverse video capabilities
+                            of your terminal. This is particularly
+                            useful   if  running  on  a  text  Sun
+                            console.
+ 
         LYNX_SAVE_SPACE     This  variable,  if set, will override
                             the  default  path  prefix  for  files
                             saved  to  disk that is defined in the
*** 1.1 1999/07/30 06:14:57
--- lynx.man    1999/07/30 06:19:45
***************
*** 590,595 ****
--- 590,600 ----
  character style sheet file.  [Currently only meaningful if \fILynx\fR was
  built using experimental color style support.]
  .TP 20
+ .B LYNX_MASK_REVERSE
+ This variable, if set, causes \fiLynx\fR to ignore any reverse video
+ capabilities of your terminal. This is particularly useful if running on
+ a text Sun console.
+ .TP 20
  .B LYNX_SAVE_SPACE
  This variable, if set, will override the default path prefix for files
  saved to disk that is defined in the \fBlynx.cfg SAVE_SPACE:\fR statement.
*** 1.1 1999/07/30 06:07:11
--- src/LYCurses.c      1999/07/30 06:11:11
***************
*** 50,55 ****
--- 50,56 ----
  
  #if USE_COLOR_TABLE || defined(USE_SLANG)
  PRIVATE int Current_Attr;
+ PRIVATE int Masked_Attr;
  #endif
  
  #define OMIT_SCN_KEEPING 0 /* whether to omit keeping of Style_className
***************
*** 106,119 ****
        int,            a)
  {
      Current_Attr |= a;
!     SLsmg_set_color(Current_Attr);
  }
  
  PUBLIC void LYsubAttr ARGS1(
        int,            a)
  {
      Current_Attr &= ~a;
!     SLsmg_set_color(Current_Attr);
  }
  
  PUBLIC void lynx_setup_colors NOARGS
--- 107,120 ----
        int,            a)
  {
      Current_Attr |= a;
!     SLsmg_set_color(Current_Attr & ~Masked_Attr);
  }
  
  PUBLIC void LYsubAttr ARGS1(
        int,            a)
  {
      Current_Attr &= ~a;
!     SLsmg_set_color(Current_Attr & ~Masked_Attr);
  }
  
  PUBLIC void lynx_setup_colors NOARGS
***************
*** 522,530 ****
                attr |= COLOR_PAIR(code+offs);
        }
  
!       wattrset(win, attr);
      } else {
!       wattrset(win, Current_Attr);
      }
  }
  
--- 523,531 ----
                attr |= COLOR_PAIR(code+offs);
        }
  
!       wattrset(win, attr & ~Masked_Attr);
      } else {
!       wattrset(win, Current_Attr & ~Masked_Attr);
      }
  }
  
***************
*** 1138,1143 ****
--- 1139,1158 ----
        (void) setterm(ttytype + 4);
      }
  #endif /* HAVE_TTYTYPE */
+ 
+     /*
+      *  Account for lossage on the 'sun' terminal type (80x24) Sun text
+      *  console driver. It only supports reverse video, but all SGR
+      *  sequences produce that same reverse video, and the terminfo
+      *  entry lists different SGRs for 'bold' and 'rev'. As a result,
+      *  the current link is indistinguishable from all other links.
+      *  The workaround here is to disable the 'rev' capability.
+      */
+ 
+     if ((strncmp((CONST char*)ttytype, "sun", 3) == 0) ||
+       getenv("LYNX_MASK_REVERSE")) {
+       Masked_Attr |= A_REVERSE;
+     }
  
  #if defined(HAVE_SIZECHANGE) && !defined(USE_SLANG) && defined(NOTDEFINED)
      if (lines_putenv != NULL) {

reply via email to

[Prev in Thread] Current Thread [Next in Thread]