Whenever a terminal emulator was the focused application, we would process keystrokes one at a time in an effort to reconstitute what had been typed in the terminal. We set up a CGEventTap which routed all keyboard events through Fig. We wanted to optimize for getting an MVP out quickly. Yes, we know, key-logger + terminal = recipe for disaster right? We knew there were plenty of issues but we also knew we would rebuild Fig with one of the below methods. The first MVP of Fig's autocomplete used what was essentially a keylogger (!!!). We think the approach we've settled on is not only pretty clever, but also maintains a user's privacy and allows us to create a powerful API that we will soon expose to 3rd party developers. We have tried multiple different approaches to get a user's edit buffer over time. These shells + plugins have direct access to what a user has typed into their shell, also called the edit buffer.įig, which is not quite a shell or terminal emulator, does not have direct access to this. After all, there are plenty of other autocomplete solutions integrated with the shell - zsh has plugins like zsh autosuggestions, fish shell comes with built-in autocomplete - but Fig is at a major disadvantage here. But how does Fig know what you've typed into your terminal? Your browser doesn't support the video tag.Īt a first glance, it might seem like this is a trivial task. Engineering ← Back to posts How does Fig know what you've typed in the terminal? Sean Sullivanįig provides drop in autocomplete for 500+ of the most common CLI tools.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |