which-command and precmd alias: does not work correctly

Bursian Achim abu.aud at siemens.com
Mon Jan 15 18:05:05 EET 2007


Hi everybody!
I have a precmd alias "source $CTROOT/env/wintitle.csh" which changes 
the window title, representing the cwd, some special envvars etc.

I bind a function key to the which-command. If I use it, I get a line of 
output for every line in the wintitle.csh script, which is undesired of 
course. Example (pressing the f-key after typing "set"):

utah{abu} 71 : set
set: shell built-in command.

: Command not found.

: Command not found.
if: shell built-in command.
set: shell built-in command.
else: shell built-in command.
set: shell built-in command.
endif: shell built-in command.

: Command not found.
if: shell built-in command.
set: shell built-in command.
else: shell built-in command.
set: shell built-in command.
endif: shell built-in command.
: Command not found.
switch: shell built-in command.
case: shell built-in command.
echo: shell built-in command.
breaksw: shell built-in command.
case: shell built-in command.
case: shell built-in command.
echo: shell built-in command.
breaksw: shell built-in command.
endsw: shell built-in command.
else: shell built-in command.
switch: shell built-in command.
case: shell built-in command.
echo: shell built-in command.
breaksw: shell built-in command.
case: shell built-in command.
case: shell built-in command.
echo: shell built-in command.
breaksw: shell built-in command.
case: shell built-in command.
cmd: Command not found.
breaksw: shell built-in command.
endsw: shell built-in command.
endif: shell built-in command.

: Command not found.
unset: shell built-in command.

: Command not found.
utah{abu} 71 : set

Without the precmd alias, all is fine.

This patch seems to fix it, but I'm not sure if this is the right thing 
to do:

*** sh.c.orig       Mon Jan 15 17:02:28 2007
--- sh.c        Mon Jan 15 17:02:47 2007
***************
*** 2147,2152 ****
--- 2147,2153 ----
         */
        if (tellwhat) {
            (void) tellmewhat(&paraml, NULL);
+           tellwhat=0;
            reset();
        }

Any tips?
  -abu



More information about the Tcsh-Bugs mailing list