0

i was wondering if there was any way of disabling the folder location on the titlebar of the built-in terminal application on Lion. I mean:

terminal titlebar

Any ideas ?

4
  • It may be useful to know why you want to disable it. Setting the Terminal working directory enables several useful behaviors, like being able to create a new terminal in the same directory, and restoring the working directory for Resume and Window Groups.
    – Chris Page
    Commented Aug 11, 2011 at 6:56
  • Aesthetics, really. I really didn't like having the folder in the prompt and in the title bar. Furthermore, if you are connected as another user (i.e. with su or ssh), the title bar shows your local folder instead of the folder of the user your connected to.
    – Aliou
    Commented Aug 11, 2011 at 23:45
  • For su, if the other user is also using bash or has set up their shell to set the working directory at each prompt (this is performed by default for bash via /etc/bashrc) the location should be correct, since it's always an absolute "file:" URL. While it's true that if you ssh to a host that isn't configured to update the working directory the value becomes stale while in that ssh session, if you set up the remote host's shell the same way it will keep the value up to date, and Terminal won't treat it as a local path if the URL names the remote host.
    – Chris Page
    Commented Aug 12, 2011 at 0:50
  • You could also arrange to clear the working directory URL specifically when starting an ssh connection. You could use an alias or a shell function to invoke ssh and send the appropriate escape sequence before starting ssh.
    – Chris Page
    Commented Aug 12, 2011 at 0:52

2 Answers 2

7

It's done in /etc/bashrc. You probably don't want to mess with that file. You can override what's done there by creating a file called .profile in your home directory that contains the following line:

unset PROMPT_COMMAND

This will remove the directory in the title bar after you restart Terminal.

0
0

I don't think it's possible in the current version of Lion (10.7.0).

However, you can personalize every other elements of the window name in the preferences of the application in the "window" tab of your window settings" (in the "Settings" pane). There you can choose wether to display the following items in the Terminal's title bar :

  • Name of the active process
  • Name of the shell command
  • Name of the window setting
  • TTY name
  • Dimensions
  • Command key

Let's hope Apple will add "current directory" to the list !

2
  • That's where i searched first, and i hope too they'll add it to the list.
    – Aliou
    Commented Aug 10, 2011 at 23:53
  • 1
    Just to set expectations: note that it's not generally possible to discover the working directory of a program connected to the tty. e.g., the program may not be on the same machine, and bash doesn't update the working directory of its process when you cd. Terminal relies on programs sending an escape sequence to tell it the working directory. It could provide a checkbox to disable displaying the information when available, but it wouldn't be able to enable the behavior for arbitrary programs. If this is desirable to you, please file an enhancement request (bugreport.apple.com).
    – Chris Page
    Commented Aug 11, 2011 at 6:24

You must log in to answer this question.

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