cwdcmd and less don't like eachother

cwdcmd and less don't like eachother

Post by Peter Galbrai » Thu, 12 Jun 1997 04:00:00



I use tcsh and have recently started to use the `cwdcmd' feature
to set the xterm or rxvt window title to the default directory and hostname.

This breaks `less', which somehow gets confused by cwdcmd.

How do I get to use less and cwdcmd at the same time?
Thanks for any help!

--

Maurice-Lamontagne Institute, Department of Fisheries and Oceans Canada
P.O. Box 1000
Mont-Joli Qc, G5H 3Z4 Canada      Tel: (418) 775-0852   FAX: (418) 775-0542

 
 
 

cwdcmd and less don't like eachother

Post by Veksler Micha » Thu, 19 Jun 1997 04:00:00


: I use tcsh and have recently started to use the `cwdcmd' feature
: to set the xterm or rxvt window title to the default directory and hostname.

: This breaks `less', which somehow gets confused by cwdcmd.

: How do I get to use less and cwdcmd at the same time?
: Thanks for any help!

.cshrc is sometimes sourced when "less" is executed. You should find out
if your shell is interactive, and only then run "alias cwdcmd ....".

 if ($?prompt && $?tty) then
    if ("$prompt" != "" && "$tty" != "") set interactive
 endif

 if ($?interactive) then
    set prompt=........
    alias cwdcmd ....
 endif

 
 
 

cwdcmd and less don't like eachother

Post by Jeremy Mathe » Thu, 19 Jun 1997 04:00:00


In fact, my .cshrc files always start with the following line:

if ($?prompt == 0) exit # None of this applies to non-interactive shells



>.cshrc is sometimes sourced when "less" is executed. You should find out
>if your shell is interactive, and only then run "alias cwdcmd ....".

> if ($?prompt && $?tty) then
>    if ("$prompt" != "" && "$tty" != "") set interactive
> endif

> if ($?interactive) then
>    set prompt=........
>    alias cwdcmd ....
> endif

************************************************************************
Drink Coke...  (Bill Hicks - 12/16/61-2/25/94)


          hundreds, if not thousands, of dollars, every time he posts -
************************************************************************
rwvpf wpnrrj ibf ijrfer

 
 
 

cwdcmd and less don't like eachother

Post by Veksler Micha » Mon, 23 Jun 1997 04:00:00


: In fact, my .cshrc files always start with the following line:

: if ($?prompt == 0) exit # None of this applies to non-interactive shells

This is not enough! There are cases that the shell is not quite
interactive, and $?prompt != 0.
e.g.
   command | tcsh

In this case:
   prompt = "%#"
   tty    = ""

(weird)



: >.cshrc is sometimes sourced when "less" is executed. You should find out
: >if your shell is interactive, and only then run "alias cwdcmd ....".
: >
: > if ($?prompt && $?tty) then
: >    if ("$prompt" != "" && "$tty" != "") set interactive
: > endif
: >
: > if ($?interactive) then
: >    set prompt=........
: >    alias cwdcmd ....
: > endif

Michael