# Customize tcsh Prompt



## tzoi516 (Mar 13, 2014)

I've read the manual and used search engines but haven't been able to find a solution. All I want to do is change the user prompt from a % to a $. When I set it via PROMPTCHARS="$#" all I get is a 0. I even tried single quotes and using "%{$%}". There aren't any prompt settings in the other .conf or.*rc files. Thanks for any help.


----------



## fonz (Mar 13, 2014)

If I'm not mistaken it's promptchars, in lower case. Exactly what is the command you are you currently using to set your prompt?


----------



## trh411 (Mar 13, 2014)

Since "$#" has special meaning in the shell (i.e., number of arguments), perhaps you need to use single quotes instead of double quotes? If using double quotes, I think you would have to escape the '$' as in "\$#". Disclaimer: I don't have a way to test this and have not used tcsh(1) in a long, long while.


----------



## tzoi516 (Mar 13, 2014)

fonz said:
			
		

> If I'm not mistaken it's promptchars, in lower case. Exactly what is the command you are you currently using to set your prompt?


It is lower case; I don't know why I capitalized in my original post.


----------



## tzoi516 (Mar 13, 2014)

trh411 said:
			
		

> Since "$#" has special meaning in the shell (i.e., number of arguments), perhaps you need to use single quotes instead of double quotes? If using double quotes, I think you would have to escape the '$' as in "\$#". Disclaimer: I don't have a way to test this and have not used tcsh(1) in a long, long while.



I just slapped my forehead for not thinking of escaping. Just tried it and it didn't work, I just get a '\'. I'm going to try single quotes again.


----------



## tzoi516 (Mar 13, 2014)

Hmmm. I must've had formatting wrong on another computer - the one I was using all day - because the single quotes, without escaping, works on this one. Thanks @trh411.


----------

