2

Consider this c-shell grab:

[<my-user>@<my-host> ~]>echo $SHELL
/bin/csh
\033]30;<my-host-name>\007\c
[<my-user>@<my-host> ~]>set | grep prompt
prompt  [%n@%m %~]%#
prompt2 %R? 
prompt3 CORRECT>%R (y|n|e|a)? 
\033]30;<my-host-name>\007\c
[<my-user>@<my-host> ~]>
\033]30;<my-host-name>\007\c

(the identity of the user and host is masked to protect the innocent)

I can't figure out where the \033]30;<my-host-name>\007\c after each line comes from, and how to make it go away.

unsetting the $prompt* variables, googleing, and grepping in the .csh* files yielded no answer.

Any ideas?

2
  • 2
    Do you have a precmd alias? (run alias | grep cmd). It looks like that alias expects a Unix compliant echo. If you change it to echo -e, that may do something more useful. Jun 2, 2014 at 15:36
  • I think that is just an escape sequence to set the hostname in a color. 033 is yellow. More than likely it is set in /etc/profile.
    – Jeight
    Jun 2, 2014 at 18:40

1 Answer 1

1

@Stéphane Chazelas's comment led me to the answer.

The fault was indeed with the precmd alias:

precmd  echo '\033]30;<my-host-name>\007\c'

Unaliasing it obviously made the offending line go away, and from there diving deeper was a breeze.

From man csh:

Automatic, periodic and timed events (+)

The beepcmd, cwdcmd, periodic, precmd, postcmd, and jobcmd Special aliases can be set, respectively, to execute commands when the shell wants to ring the bell, when the working directory changes, every tperiod minutes, before each prompt, before each command gets executed, after each command gets executed, and when a job is started or is brought into the foreground.

Thanks.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .