If any of the [files sourced in the shell startup](http://macromates.com/textmate/manual/shell_commands#search_path) changes the current working directory, it will break the templates.
If you need to change the current working directory (e.g. in `~/.bash_profile`) then you can restrict it to only happen for interactive shells by using a line like this:
- - -
See also: [Shell Commands](ShellCommands)