3,214 karma · joined January 23, 2011
https://gitlab.com/gnachman/iterm2/wikis/iTerm2-Version-3.3-...
I can help with that:
https://www.apple.com/sg_smb_5200/shop/product/MB571Z/A/mini...
Half the charm is lost without seeing the two DVI cables that plug in to it.
It's funny you should mention this. After someone sent me an amazing pull request using this call, I thought "hm, this should be in Mac OS X Internals: A Systems Approach. Why didn't I see it?" So I looked it up, and yes, it's there, but there's nowhere near enough context or description for it to be of use to anyone but (at most) the author. Here's what it says:
The /usr/libexec/StartupItemContext program can be used to run an executable in the startup context—that is, the context in which the Mac OS X startup items run. It works by calling bootstrap_parent() repeatedly until it has reached the startup (root) context. It then sets the port as its own bootstrap port, after which it can execute the requested program.
The automatic relaunching of servers by the Bootstrap Server is useful for creating crash-resistant servers. However, it is neither necessary not advisable to create production servers by directly using the Bootstrap Server interface. Beginning with MacOS X 10.4, the launch API, as exported through <launch.h>, should be used. With this caveat, let us look at two examples of using the Bootstrap Server interface.
[an example that shows how to list all known services]
[a rather complex example that creates a bootstrap service and maybe uses bootstrap_parent somewhere]
There are bits of wisdom in this wonderfully written (and of course now obsolete) tech note:
https://developer.apple.com/library/archive/technotes/tn2083...
But of course, most people just copy-paste from the code Apple has (I would guess grudgingly) made open-source and we hope for the best.
NSTitleBarAccessoryViewController lacked documentation from the time it was introduced in macOS 10.10 until recently (perhaps Mojave? That's when I first found it). There was literally nothing except the header file and the announcment in the release notes for the OS. It was also full of bugs that rendered it unusable for my application.
Overriding -scrollWheel: has all kinds of nonsense side-effects. These are only documented in release notes. Scroll wheels in general are way more complex than you'd imagine. If it weren't for Chrome's open source Mac code, it would be a complete mystery. See the investigation here (search for "of mice and men") for what Apple should have documented: https://chromium.googlesource.com/chromium/blink/+/d40e271ac...
Passing a constant buffer to a fragment shader will cause it to be truncated at 64k on some graphics drivers. Not a bug, just an undocumented limitation. Doesn't happen on my computer. That was fun to figure out.
NSMapTable with weak keys and strong value leaks the values, according to an archived document. The main docs say nothing on the topic.
If you'd like to know why an exception was thrown, you have to print the value of the proper CPU register. On x86-64 it's $rax. As far as I know this is an oral tradition, passed down from senior developer to junior developer.
If you want a daemon to survive the user logging out and logging in, you have to use a barely-documented function (bootstrap_parent) which is only mentioned in a now-archived tech note.
It's been solved twice, but I'd like to get that down to just once :)
https://sw.kovidgoyal.net/kitty/protocol-extensions.html#key...
iTerm2 can detect this if you install shell integration. I wish there were a more standard way to deal with this scenario, which affects everything in a terminal that has a mode (focus reporting, mouse reporting, application keypad mode, etc.).