Sublime Forum

Project name in the window title

#4

Probably worth an FR on the issue tracker :smile:

0 Likes

#5

Yes please. File - Project - Folder would be the best IMO.

0 Likes

#6

No, “Project - File” is much better

2 Likes

#7

Config option would be better then lol

2 Likes

#8

Completely agreed.

0 Likes

#9

Also being able to specify a custom project name and allow project definition files without a basename.

So you can have:

~/path/to/project/.sublime-project

{
    "name" : "Project X"
}
2 Likes

#10

I created an issue here.

I too would like the ability to have the project name displayed first, as I find myself with 3-10 sublime text windows open to different projects at any given time. Having the project name there is essential to being able to alt-tab quickly between projects.

1 Like

#11

Virtual Desktops are your friend :slight_smile:

0 Likes

#12

Ultra wide screens are also your friend. Love them.

The most recent issue complaining about this is:

  1. #1445, Feature request: specify general window title
  2. #1348, Make the “show_full_path”: true, show the path after the file name
  3. #1179, Add ability to configure window title content format
  4. #144, Feature request: specify general window title

The current window title style is not good. The most up voted and general feature/issue to fix this is https://github.com/SublimeTextIssues/Core/issues/1179.

1 Like

#13

Hi, I just created a plugin to configure the window title. (for Linux)

It should be soon in Package Control, but you can install it manually if you want to test it earlier.

Please provide feedback here or on Github.

2 Likes

#14

@gwenzek, could you mark your package as for all platforms in Package Control? Currently, it’s limited to only Linux, so Windows users can’t install it via Package Control.

0 Likes

#15

@skoshy: There are some bugs in the Windows version.
That’s why it’s not officially released yet on this platform.
I don’t have an easy access to a Windows PC that’s why it’s not making a lot of progress.

If you want to look into it or just try it on Windows and tell me if it works, it’ll be helpful.

0 Likes

#16

I made an AutoHotKey script for Windows. This just removes a couple specific hardcoded prefixes from the paths in the title, but it solves the problem for me, for now.

#KeyHistory 0
#NoEnv
#NoTrayIcon
#SingleInstance Force

Loop {
	SetTitleMatchMode RegEx
	WinGet, ids, list, Sublime Text,,
	SetTitleMatchMode 3 ; or whatever default, if part of a larger script
	Loop %ids% {
		id := ids%A_Index%
		WinGetTitle, title, ahk_id %id%
		title := StrReplace(title, "C:\Users\Isaiah\Projects\", "")
		title := StrReplace(title, "C:\Users\Isaiah\Google Drive\", "")
		WinSetTitle, ahk_id %id%,, %title%
	}
	Sleep 100
}

Trying that SublimeSetWindowTitle plugin, it seems to work well (on Windows); I’m going to use it in conjunction with my AHK script for now - for windows without a project directory defined, and for when an image preview tab is focused.

0 Likes

#17

Hello gwenzek !

I don’t understand how to set the plugin and use it.
How access to the plugin settings on Windows ? It doesn’t appear in Preferences > Package Settings

Thanks

0 Likes

#18

I never added a menu entry to edit the settings because it’s a plugin for H4ck3rs :stuck_out_tongue_winking_eye:

You’ll need to manually create a setting file in your Packages/User directory.

Otherwise there is a plugin that allows you to edit all settings files even when the author of the plugin forgot to add a menu entry for that:
https://packagecontrol.io/packages/Side-by-Side%20Settings

1 Like

#19

It works like a charm, thanks !
It’s not really what I expect –I’d like to replace with custom regex path by a custom label– but that’s ever good !

For unregistered users we cannot hide the mention “(UNREGISTERED)” even is not really fair play… ?
I’d put "unregistered": true in the setting file but I don’t see what does it change on ST 3.1.1

0 Likes

#20

Thanks, this is just what I needed. I agree that having the settings in the menu would be good, but your tip to use the Side-by-Side setting package worked for me. (otherwise it would have been a bit confusing for me to manually create the settings, file)

It doesn’t seem to update the Window titles right away when you change the pattern in the settings (I had to restart Sublime, perhaps that is to be expected). Another thing that might be more of a bug is that it doesn’t seem to write the title of the window until you focus the window. In my setup I tend to have three or four sublime windows open with different project, and each time I changed your plugin’s settings file and restarted Sublime, I would have to click on each Sublime window for it to update the title (otherwise, it was just showing the default title format)

(edit: I’m running Windows, not sure if the bug mentioned is a Windows-specific thing.)

Another option for displaying the file path that you don’t seem to have would be “just the filename”, but I do like the “relative to project” option that you have.

Thanks!

0 Likes

#21

I’d like to replace with custom regex path by a custom label.

Could you describe a bit more what you want to do ? That sounds interesting.

I put “unregistered”: true in the setting file but I don’t see what does it change on ST 3.1.1

The plugin finds the Sublime windows by its name, the settings allows to look for windows ending by “(UNREGISTERED)”.
Without the setting set the plugin will probably won’t work.

0 Likes

#22

It doesn’t seem to update the Window titles right away when you change the pattern in the settings
Another option for displaying the file path that you don’t seem to have would be “just the filename”

Good ideas, I added that. It will arrive with the next release. I have a Windows PR I’d like to test before doing the release.

it doesn’t seem to write the title of the window until you focus the window.

This is a Windows only restriction. Sublime freeze if I try to change the title in “plugin_loaded” callback. I don’t know why. So on Windows you have to select all windows one by one. I’ll try to come up with a better system, but it’s not easy.

0 Likes

#23

This has been solved in st4, as described here: https://github.com/sublimehq/sublime_text/issues/1179#issuecomment-846689267

In your settings, set "show_project_first": true,

0 Likes