Edit:
Ha! I figured it out! AppKit has always had this functionality! You just need to execute a command like this, which writes a NSUserKeyEquivalent
with 0x1B
(ASCII ESC, \e
, \033
) as seperator between the titles in the title path:
defaults write com.apple.Terminal NSUserKeyEquivalents -dict-add $'\eShell\eNew Window\eMan Page' '@$m'
…or you can also just type Shell->New Window->Man Page
in the "Menu title" field in system settings, which does this for you.
source: decompile AppKit and search for "titlepathbased" strings; landed on -[NSMenuItem _fetchFreshUserKeyEquivalentInfo]
which mentions r13 = loc_7ff841d3cc10(rbx, @selector(componentsJoinedByString:), @"\x1B");
. Also referenced this apple community question. This also answers your question.
Tested pass on Ventura 13.4 22F66.
ORIGINAL ANSWER:
I think you are using the "NSUserKeyEquivalents" feature in AppKit, which apple calls "App Shortcuts". Apple does not let you use a menu path there, and when multiple items share the same name, like in Terminal.app, strange things happen. Shortcuts may work the first time but from the second time appkit will invoke another one with the same name (which you can tell by watching the menu bar item blink).
AppKit does have a global variable called _hasTitlePathBasedUserKeyEquivalent
, which may signal that with some hacking we can make it do what you want. Until then, you will want to check out some third-party productivity tools that may hack macos or invoke the menu title indirectly.