Professional Web Applications Themes

Less (more) environment COLUMNS conflict - SCO

I have attempted to use less from Skunkware on a 5.0.5 system as a file viewing utility for a client. Problem: The client's application changes the screen to 132 column mode prior to sending the output. I have set the following in the users global environmental configuration file for the application startup: LESS="--chop-long-lines --shift 8"; export LESS COLUMNS=132; export COLUMNS This works as intended as the application changes the screen to 132 column by sending "ESC[?3h", pipes the output through less and after the user closes the less window, resets the screen to 80 column mode. The problem is that ...

  1. #1

    Default RE: Less (more) environment COLUMNS conflict

    I have attempted to use less from Skunkware on a 5.0.5 system as a
    file viewing utility for a client.

    Problem: The client's application changes the screen to 132 column mode
    prior to sending the output.

    I have set the following in the users global environmental configuration
    file for
    the application startup:

    LESS="--chop-long-lines --shift 8"; export LESS
    COLUMNS=132; export COLUMNS

    This works as intended as the application changes the screen to 132
    column
    by sending "ESC[?3h", pipes the output through less and after the user
    closes
    the less window, resets the screen to 80 column mode.

    The problem is that the client's application also respects the
    COLUMNS=132
    setting and popup windows are crowded to the right edge of the 80 column
    screen
    and in some cases wrap the right edge of the screen.

    Eliminating the COLUMNS=132 environment variable fixes the application
    display but
    then Less does not display properly when the application switches to 132
    column mode.

    setting LESS="--chop-long-lines --shift 8 --columns=132"; export LESS

    does not work. In fact, with the above, less aborts with:
    columns=132 is an ambiguous abbreviation ("more --help" for help)
    but untill you correct the offending abbreviation, less --help will
    abort with the same message. (Note to Less programmer: fix error
    handling to
    accept the case --help)

    and LESSCOLUMNS=132 does not work.

    My options look to be to obtain the source for LESS and modify it to
    respect
    LESSCOLUMNS=132.

    Where can I download the less source code? Or is there already an
    undoented
    --lss-command that will allow me to set 132 column from the command
    line?

    JP: Any other options, or suggestions?

    I have tried LESSOPEN and LESSCLOSE and find nothing I do causes the
    shell command
    file listed in LESSCLOSE to run when quitting from LESS. The shell
    command file
    listed in LESSOPEN does run but all attempts to have the client's
    application run
    the shell command in place of less has failed.

    Note: less supplied as standard for 5.0.6 behaves the same as the
    version from
    Skunkware 2000.

    --

    Steve Fabac
    S.M. Fabac & Associates
    816/765-1670
    Steve Guest

  2. #2

    Default Re: Less (more) environment COLUMNS conflict

    Steve M. Fabac, Jr. typed (on Thu, Nov 20, 2003 at 05:05:23PM +0000):
    | I have attempted to use less from Skunkware on a 5.0.5 system as a
    | file viewing utility for a client.
    |
    | Problem: The client's application changes the screen to 132 column mode
    | prior to sending the output.
    |
    | I have set the following in the users global environmental configuration
    | file for
    | the application startup:
    |
    | LESS="--chop-long-lines --shift 8"; export LESS
    | COLUMNS=132; export COLUMNS
    |
    | This works as intended as the application changes the screen to 132
    | column
    | by sending "ESC[?3h", pipes the output through less and after the user
    | closes
    | the less window, resets the screen to 80 column mode.
    |
    | The problem is that the client's application also respects the
    | COLUMNS=132
    | setting and popup windows are crowded to the right edge of the 80 column
    | screen
    | and in some cases wrap the right edge of the screen.
    |
    | Eliminating the COLUMNS=132 environment variable fixes the application
    | display but
    | then Less does not display properly when the application switches to 132
    | column mode.
    |
    | setting LESS="--chop-long-lines --shift 8 --columns=132"; export LESS
    |
    | does not work. In fact, with the above, less aborts with:
    | columns=132 is an ambiguous abbreviation ("more --help" for help)
    | but untill you correct the offending abbreviation, less --help will
    | abort with the same message. (Note to Less programmer: fix error
    | handling to
    | accept the case --help)
    |
    | and LESSCOLUMNS=132 does not work.
    |
    | My options look to be to obtain the source for LESS and modify it to
    | respect
    | LESSCOLUMNS=132.
    |
    | Where can I download the less source code? Or is there already an
    | undoented
    | --lss-command that will allow me to set 132 column from the command
    | line?

    I've got the source code on ftp.jpr.com.

    | JP: Any other options, or suggestions?

    man lesskey

    | I have tried LESSOPEN and LESSCLOSE and find nothing I do causes the
    | shell command
    | file listed in LESSCLOSE to run when quitting from LESS. The shell
    | command file
    | listed in LESSOPEN does run but all attempts to have the client's
    | application run
    | the shell command in place of less has failed.
    |
    | Note: less supplied as standard for 5.0.6 behaves the same as the
    | version from
    | Skunkware 2000.
    |
    | --
    |
    | Steve Fabac
    | S.M. Fabac & Associates
    | 816/765-1670

    --
    JP
    Jean-Pierre Guest

  3. #3

    Default Re: Less (more) environment COLUMNS conflict

    Steve M. Fabac, Jr. wrote:
     

    Tell the application to run /wherever/less132 instead of /wherever/less.
    /wherever/less132 says:

    #!/bin/sh
    COLUMNS=132 exec /wherever/less --chop-long-lines --shift 8 "$"

    Speaking of 132-column lines, wrapping and all that jazz, please slap
    Mozilla upside the head until it figures out how to post news correctly.
     
    Bela Guest

  4. #4

    Default Re: Less (more) environment COLUMNS conflict



    Bela Lubkin wrote: 
    >
    > Tell the application to run /wherever/less132 instead of /wherever/less.
    > /wherever/less132 says:
    >
    > #!/bin/sh
    > COLUMNS=132 exec /wherever/less --chop-long-lines --shift 8 "$"
    >
    > Speaking of 132-column lines, wrapping and all that jazz, please slap
    > Mozilla upside the head until it figures out how to post news correctly.[/ref]

    Changed from 72 to 92, hope that works. Normally, I try to remember to
    uncheck "wrap long lines" prior to sending but missed it on this one.
     [/ref]

    Thanks Bela, that did the trick. less132 that worked is:

    #!/bin/sh
    COLUMNS=132; export COLUMNS
    exec /usr/local/bin/less --chop-long-lines --shift 8 "%"

    --

    Steve Fabac
    S.M. Fabac & Associates
    816/765-1670
    Steve Guest

Similar Threads

  1. IIS and FMS conflict
    By _|-_|- in forum Macromedia Flash Flashcom
    Replies: 1
    Last Post: July 21st, 12:43 AM
  2. Columns and Inherited Datagrid...Active Schema does not support columns
    By rob thomson in forum ASP.NET Data Grid Control
    Replies: 0
    Last Post: September 4th, 03:09 PM
  3. LAN & DSL conflict
    By Dmiriy in forum Windows Networking
    Replies: 0
    Last Post: July 21st, 12:17 AM
  4. Replies: 0
    Last Post: July 2nd, 06:18 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139