In the Terminal preferences you can find an option to open new windows and tabs in the current working directory. Yet there's a message that says that programs notify Terminal about the current working directory using scape sequences, which I don't know what it means.
But the Terminal itself is not doing this, as I would like to create a new tab when I press Cmd ⌘ + T to open at the same working directory (not ~/
).
I found this post but it doesn't address this. Here you have a figure with the options:
PROMPT_COMMAND
is executed by the shell every time the prompt is displayed. The Terminal behavior you're looking for depends upon that variable being set to a function calledupdate_terminal_cwd
, which outputs your current working directory as a URL in a manner that is intercepted by Terminal so that it knows where you are. You were overwriting that setting. – Mark Reed Sep 12 '14 at 13:56export
is unnecessary and undesirable with shell variables—variables that are specific to the shell's behavior and not used by other programs invoked from the shell. There's no need to export shell variables, because interactive sub-shells will execute the startup script, and it is generally undesirable to export variables to programs run from the shell unless you intend for them to use it. – Chris Page Dec 11 '15 at 00:51