Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is this possible at all? (basically a pendant to cmd.exe's title command that Mikel's answer mentions, although I'd prefer changing the entire tab name instead of adding a window title)

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

In bash, the standard Xterm sequences documented at How to change the title of an xterm seem to work, e.g.

echo -e "\033]0;custom title\007"; cat

So try adding that to your PS1 in your .bashrc or whichever config file you use, e.g:

PS1="\033]0;\$PWD\007$PS1"

or use PROMPT_COMMAND instead if you are using bash.


In cmd.exe, you can use title <string> to set the title.

You would chain it together using a doskey alias like this:

doskey cd=title $1 ^&^& cd $1

Then set it to load for every new cmd using the instructions in Loading DOSKEY Automatically with CMD.


In both cases, to show only the window title, go to Settings->Appearance and tick the
Use console window title* box.

share|improve this answer
    
I'm afraid title is a built-in of cmd.exe, so bash claims bash: title: command not found :( but it works for cmd.exe, so +1 –  Tobias Kienzler Jan 20 '11 at 12:41
    
thanks for the update - wow, doskey's still around? Hm, I'd probably first of all doskey alias=doske –  Tobias Kienzler Jan 20 '11 at 12:51
    
Yes, my original answer was only for cmd. I have updated it with instructions for bash. –  Mikel Jan 20 '11 at 12:58
    
your current solution won't change the working directory, using PS1='\033]0;\u@\h:\w\007'$PS1 instead does the trick –  Tobias Kienzler Jan 20 '11 at 13:17
    
Sorry, yes, there was a missing backslash. It is fixed now. –  Mikel Jan 20 '11 at 13:18
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.