Jake
Jake

Reputation: 261

Why does the TextMate title bar not show the file path when opened with the "mate" command?

When I open a file in TextMate using the mate command the title bar does not allow me to right click to see the path of the file while files opened within the TextMate app do show the full path. Is there something about the behavior of the mate command that prevents this functionality or is this a bug?

Upvotes: 4

Views: 1355

Answers (4)

Ruuts
Ruuts

Reputation: 11

I think TextMate has updated the documentation on their website. It even contains a similar snippet to solve the issue above.

For example, if we want to show the path as relative to the project folder, we can use:

windowTitle = '${TM_DIRECTORY:+${TM_DIRECTORY/^${projectDirectory}(?:\/(.+))?/${1:+$1/}/}}$TM_DISPLAYNAME$windowTitleProject$windowTitleSCM'

Source: https://macromates.com/textmate/manual/projects

Upvotes: 1

Tamila
Tamila

Reputation: 41

  1. Go to folder "/Applications/TextMate.app/Contents/Resources" or where your TextMate.app installation folder. Close textmate app before modifying the file.

  2. Modify the file Default.tmProperties as below. I have provided the diff here:

    diff Default.tmProperties
    ../textmateBin/TextMate.app/Contents/Resources/Default.tmProperties 10c10

    < windowTitleProject = '${projectDirectory:+ — ${projectDirectory}}'

    windowTitleProject = '${projectDirectory:+ — ${projectDirectory/^.*///}}'

  3. Restart your textmate app and it should display your folder path :)

Upvotes: 1

bloke_zero
bloke_zero

Reputation: 508

If you have a local project .tm_properties file it's trivial to have TM2 display the path - add something like:

windowTitle = "$TM_DISPLAYNAME – $TM_DIRECTORY"

Works with $ mate [filename] in terminal and in normal finder use.

But I agree it's pretty lame that it doesn't seem to work for the global .tm_properties - though I'd love to be proved wrong!

Upvotes: 2

Jake
Jake

Reputation: 261

If you wish to have the path visible in the title bar the mate command must include the full path of the file. Using mate with an assumed current working directory (CWD) does not inherently provide mate the full file path.

Upvotes: 2

Related Questions