typora-issues icon indicating copy to clipboard operation
typora-issues copied to clipboard

Append path or root directory to title bar to easily identify multiple Typora windows

Open andrewbrereton opened this issue 6 years ago • 5 comments

Perhaps this could be a configuration option.

I have multiple Typora instance open: blog, books, work, ideas, etc.

Each instance is pointing to a different directory.

When I'm selecting which Typora window I want to open, I am often opening multiple because the file name alone is not enough for me to differentiate which project it relates to.

If I could prepend the root directory name (the top-most directory from my File-Tree View) to the title then this would be easier.

andrewbrereton avatar Feb 14 '19 23:02 andrewbrereton

Which OS?

Linux/Windows version could be possible, while on macOS the titlebar follows macOS' logic (same as TextEdit.app).

abnerlee avatar Feb 15 '19 14:02 abnerlee

OSX sorry.

andrewbrereton avatar Feb 15 '19 16:02 andrewbrereton

Any chance this could be prioritized? It's a very longstanding issue, and has more votes (in the form of duplicates) than most issues.

nk9 avatar Dec 31 '24 17:12 nk9

Linux/Windows version could be possible, while on macOS the titlebar follows macOS' logic (same as TextEdit.app).

sooo... iOS has been holding us back for 6+ years??? ummm yeahhh... keep it simple.

anyway...

I just wrote this little hack of script, its working 95% of the time. If your on windows and know how to to use AutoHotkey v1 you can put this in your script.

SetTimer, SetPathInTyoporaTitleBar, 1000

SetPathInTyoporaTitleBar:
IfWinNotExist,  - Typora ahk_class Chrome_WidgetWin_1 ahk_exe Typora.exe
	Return

WinGetTitle, TypoTitle,  - Typora ahk_class Chrome_WidgetWin_1 ahk_exe Typora.exe
TypoTitle := StrSplit(TypoTitle," - Typora").1

Recent := AppData "\Microsoft\Windows\Recent"
If FileExist(Recent "\" TypoTitle ".lnk")
	{
		FileGetShortcut, %Recent%\%TypoTitle%.lnk, TypoANX_filepath
		WinSetTitle, - Typora ahk_class Chrome_WidgetWin_1 ahk_exe Typora.exe,, %TypoANX_filepath% - Typora
	}
Return
Image

alternatively

typo keeps a log of recently opened files (when turned on in prefs)... %appdata%\Typora\typora.log , the file paths could be parsed and applied to the title bar.

Image

indigofairyx avatar Aug 15 '25 23:08 indigofairyx

macOS is not preventing this from being fixed. NSWindow has a subtitle property which lets you add extra details to a window's title. You just need to loop through the existing open windows whenever a document opens/closes and update the appropriate subtitles if there is ever a conflict.

if let win = self.view.window {
    win.subtitle = "~/path"
}
Image

The document window's title bar still behaves the same:

Image

nk9 avatar Aug 16 '25 20:08 nk9