This is a discussion on RE: Less (more) environment COLUMNS conflict within the Sco Unix forums, part of the Unix Operating Systems category; --> I have attempted to use less from Skunkware on a 5.0.5 system as a file viewing utility for a ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 undocumented --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 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 | undocumented | --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 |
| |||
| Steve M. Fabac, Jr. wrote: > 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. 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< |
| ||||
| Bela Lubkin wrote: > > Steve M. Fabac, Jr. wrote: > > > 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. > > 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. 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. > > >Bela< 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 |