@mitchellh Hello! I got a report that Ghostty is erroneously offering one-time codes that users receive on their Mac while they're using Ghostty. AutoFill only offers these codes in contexts where it believes that the text input context's content is empty, which leads me to believe that Ghostty text editing system is not conforming to the NSTextInputClient properly, probably for good reason!

Anyway, I'm writing to tell you that if you get any complaints about OTCs being offered in Ghostty, this page tells you how to deal with it (you can turn AutoFill of delivered one-time codes off for the app): https://developer.apple.com/documentation/bundleresources/information-property-list/nsautofillrequirestextcontenttypeforonetimecodeonmac

NSAutoFillRequiresTextContentTypeForOneTimeCodeOnMac | Apple Developer Documentation

A Boolean value that indicates whether text fields receive AutoFill of one-time codes only if they adopt the suitable content type.

Apple Developer Documentation

@rmondello First of all, big fan of the work you do I’ve seen your commentary pop up a lot and of course I consume it within the Apple ecosystem daily. Thank you.

Second, thank you! Yes, I noticed 26.2 (I think) reintroduced this. I previously had a very bad workaround. Let me read this doc and do the right thing. Thank you.

@mitchellh Wow, thank you for the kind words! I appreciate them.

You noticed right. As of 26.2, we’ll only ever query an app’s NSTextInputClients methods for text content and cursor rect information *when there is a OTC to display*, which drastically cuts down on the performance issues that folks saw. Basically, we’ll only ever ask your text system for information for AutoFill when it’s highly likely to be in benefit to the user.

As part of that change in 26.2, we rejiggered some things so that the workarounds that folks were using to turn all of AutoFill off wouldn’t work anymore — kind of a reset. The page I sent you is about the supported way to modify this behavior.

@rmondello Thanks for the background! This is now done: https://github.com/ghostty-org/ghostty/pull/11351

Question: my heads spinning around ideas where terminal apps could use a sequence to advertise that they're awaiting a one time code, and I could dynamically shift my content type. Is this something that could be done or is this being cached so hard that its not feasible?

macos: disable Tahoe one-time codes by mitchellh · Pull Request #11351 · ghostty-org/ghostty

This disables all the automatic one-time code inputs in Ghostty. It'd be really neat to actually dynamically change this (not sure if it's possible with NSTextContext or how often thats cac...

GitHub