Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I use guake very heavily, and ssh into more than 3 computers at any point in time. I also have daemons running on some tabs (terminals). What I want to know, Is it possible to have the name of the current command as the name of the Terminal? Rightclikcing a tab, and changing its name causes this: (Look at the tab after Terminal 5)

Look at the tab after Terminal 5

Thanks.

share|improve this question
    
See my answer to a related question to show an abbreviated representation of the current directory as tab title. –  krlmlr May 15 '13 at 8:22
add comment

5 Answers

up vote 3 down vote accepted

This is a guake (0.4.1) bug. I just see and solve this problem via this bug report though the author say this is not the best method: http://guake.org/ticket/205

i've found out that moving the dialog destruction code (guake.py line 983) down after the code that sets the tab label (line 986) actually solves the problem. so the the code that works for me look like this:

    response = dialog.run()
    # dialog.destroy() 

    if response == gtk.RESPONSE_ACCEPT:
        self.selected_tab.set_label(entry.get_text())

    dialog.destroy()

maybe there is some problem with gtk and dialogs, but i haven't found any code changes connected with gtk in the version 0.4.1 diff.

EDIT: guake 0.4.2 can change the tab name correctly

share|improve this answer
add comment

I am not sure this works for guake, it works for most terminal emulators. You can include an echo on your scripts to change the terminal title:

echo -ne "\033]0;your_title_here\007"
share|improve this answer
    
that didnt work, when I typed it in the terminal. –  theTuxRacer Dec 27 '10 at 11:25
1  
That's because your shell's prompt will usually set it to the current working directory. Check the PS1 variable. –  ak2 Dec 27 '10 at 13:12
add comment

When I want to change the tab name in guake, I just right-click the tab name and left-click rename. A pop-up box opens to type the new name into.

share|improve this answer
add comment

If you change your shell to zsh, you can add this to your ~/.zshrc:

preexec() {
    echo -n '\e]0;'
    echo -nE "$1"
    print -nP '  (%~)'
    echo -n '\a'
}

and it will show the current command and the current working directory. This works for all terminal emulators, not just guake.

To install zsh:

sudo apt-get install zsh

to try it out just say

zsh

to make it your default for new terminals:

chsh -s /bin/zsh 
share|improve this answer
1  
zsh doesnt work at all with guake :( –  theTuxRacer Jan 11 '11 at 4:14
    
Oh, right, I remember hitting that problem before. But at least some of the bugs relating to it now seem to be fixed, eg <guake.org/ticket/49>;. –  poolie Jan 11 '11 at 15:14
add comment

Bit of a hack, but this will rename the current terminal to whatever you ssh'ed for.

function ssh() {
    guake -r "$@";
    /usr/bin/ssh $@
}

Also if you update your PROMPT_COMMAND, you can have a function to update the terminal name each time. Although this will not work for your ssh problem as it only changes the name after the command has run.

e.g.

export PROMPT_COMMAND=renameTerminal

function renameTerminal() {
    guake -r "$SOMENAME";
}
share|improve this answer
add comment

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.