tcsh dosen't echo ^[ as a control character

tcsh dosen't echo ^[ as a control character

Post by Bowen Gole » Tue, 25 Jan 1994 05:09:29



Tcsh dosen't seem to like echoing \ESC as the actual escape character.  I would
like to diddle with the prompt, but any attempt at using various forms of the
escape character are converted into ^[ (caret-bracket) instead of escape.  
Available documentation did not shed much light on the problem.  Csh, on the
other hand, gladly echos characters without conversion.  Any ideas?

        -bg
--
-------------------------------------------------------------------------------
Bowen Goletz                                      Public Affairs Video Archives
Systems Administrator                                         Purdue University

 
 
 

tcsh dosen't echo ^[ as a control character

Post by K. Brun » Tue, 25 Jan 1994 05:43:11



>Tcsh dosen't seem to like echoing \ESC as the actual escape character.  I would
>like to diddle with the prompt, but any attempt at using various forms of the
>escape character are converted into ^[ (caret-bracket) instead of escape.  
>Available documentation did not shed much light on the problem.  Csh, on the
>other hand, gladly echos characters without conversion.  Any ideas?

Try typing ctrl-V before the control character.  This causes tcsh not to
interpret the control character itself.

--
Dilbert:  I can remember when these were only fif* cents.  But I'm
          really dating myself now...
Dogbert:  Well, it's not as if anyone else would date you.

 
 
 

tcsh dosen't echo ^[ as a control character

Post by Stefan Monni » Wed, 26 Jan 1994 00:21:11




> Tcsh dosen't seem to like echoing \ESC as the actual escape character.  I would
> like to diddle with the prompt, but any attempt at using various forms of the
> escape character are converted into ^[ (caret-bracket) instead of escape.  
> Available documentation did not shed much light on the problem.  Csh, on the
> other hand, gladly echos characters without conversion.  Any ideas?

I'm not sure what your problem is but I feel like it's the same as I
had to put my machine name in the xterm title (and change it whenever
I telnet in/out). The escape sequence is translated into plain ascii
characters automatically. To remove that translation, you need to
enclose the string within curly braces (preceded by percent):

        set prompt = "%{\033]0;${LOCALHOST:h}\007%}%B%C2-%?%#%b "

This is explained in the tcsh man page about special commands for the
prompt string (section 12)

        Stefan
--

-----------------------------------------------------
-- On the average, people seem to be acting normal --
-----------------------------------------------------

 
 
 

tcsh dosen't echo ^[ as a control character

Post by jacob morzins » Tue, 25 Jan 1994 09:09:00




>>Tcsh dosen't seem to like echoing \ESC as the actual escape character.  I would
>>like to diddle with the prompt, but any attempt at using various forms of the
>>escape character are converted into ^[ (caret-bracket) instead of escape.  
>>Available documentation did not shed much light on the problem.  Csh, on the
>>other hand, gladly echos characters without conversion.  Any ideas?

>Try typing ctrl-V before the control character.  This causes tcsh not to
>interpret the control character itself.

Then again, tcsh treats the prompt string as a format statement, and
csh treats it like a literal string.  In csh, try typing:
% set prompt="hi ^M:"         # that's "hi<sp><C-M>:"
% echo $prompt

...and you will see that csh displays the literal $prompt as your
prompt string.  Then try tcsh:
% set prompt="%m ^M:"         # (%m for machine name)
% echo $prompt

(Note: on my terminal, the ^J and ^M keys are reversed...I had to type
^V^J in order to get the ^M shown above...)

The prompt will be _displayed_ as "takagi ^M:" (in my case), but the
prompt string will echo as ":m" ("%m", followed by a <cr> and ":").

Perhaps the reason your escape codes don't work is that they need to
be interpreted by the screen in order to work, instead of interpreted
by tcsh.  (No, I don't know how to fix it.  I have learned how to
embed a carraige return in the prompt string, but not how to get tcsh
to actually _perform_ the carriage return.)

--
 /-----------------------------------------------------------------\

\           f u cn rd ths, u cn gt a gd jb n cmptr prgrmmng.        /
 \-----------------------------------------------------------------/

 
 
 

1. ytalk dosen't like tcsh ?

Hiya :)

Come across a curious problem with ytalk -- I haven't been able to trace
the problem down.

When starting a shell in ytalk using ESC-s and the user has tcsh as the log
in shell, it dosen't start a shell, but instead says
        tcsh: permission denied
and then terminates.

It is fine with ksh and bash...! Any suggestions?

tcsh is in /etc/shells, and has perms of 755.

TIA,

Chris...

--
<-------------------------------+------------------------------------------->
Chris Johnson                   :  Epoch ends on Mon Jan 18 17:14:07 2038 GMT

http://pine.shu.ac.uk/~cjohnso0 :  UNIX will still be going strong :-)

2. csh foreach ( ` cat file ` ) question

3. how do I echo a control character?

4. linux being user-friendly

5. Echoing control characters on the crt (System V)

6. LinuxPPC missing thoughts ....

7. echoing control-characters from the command-line

8. time config

9. Problem echoing special characters with '<<'

10. can't "stty -echo nl" in tcsh in Emacs M-x shell

11. Echo'ing a dash as the first character in BSD

12. Why can't I echo control codes with SED