Coder Social home page Coder Social logo

Integrate Fig with Windows about fig HOT 36 OPEN

withfig avatar withfig commented on July 21, 2024 244
Integrate Fig with Windows

from fig.

Comments (36)

mschrage avatar mschrage commented on July 21, 2024 79

Some exciting progress to share!

windows_fig_demo.mp4

We've located the caret position, can determine what text has been typed, and got IPC working on Windows. 🥳 There is still lots to do, but some of the key technical challenges have been solved!

We likely will focus on WSL at first and then branch out to support other environments, like git bash and Powershell.

from fig.

haltcase avatar haltcase commented on July 21, 2024 33

Could we please keep the comments here limited to the issue and move other comments to a discussion? I'd like to stay connected with progress to Fig coming to Windows, but notifications like these last few can be very noisy.

from fig.

mschrage avatar mschrage commented on July 21, 2024 32

Hey everyone! Thank you for your patience. We are super excited about bringing Fig to Windows, but there is lots of work to do before this is possible.

There are at least 7 core functions that need to be built out in order for us to release autocomplete to Windows.

  1. We need to be able to determine the location of the cursor in a 3rd party app.

This seems possible using Microsoft Active Accessibility APIs.

Other Resources

  1. We need to be able to determine what you've typed in the terminal

This means porting our pseudoterminal layer (figterm) to Window. We need to do some research to understand how this should work on a non-UNIX system.
See ConPTY

  1. We need to do IPC between our CLI tools and our GUI app. On macOS (and Linux) we use UNIX domain sockets. I am not sure about the equivalent on Windows.

  2. We need to be able to position a 'floating' window overlay on top of 3rd party applications.

  3. We need intercept certain keystrokes to prevent them from being handled by the shell. This can be implemented at the OS level or potentially at the pseudoterminal level.

  4. We need to port over the Fig.js API to Windows. This is the subsystem that links our TypeScript autocomplete engine with native OS functionality.

  5. We need to install our shell integrations. This entails research & experimentation with how shells work on Windows. eg. What is the difference between Cygwin, MSYS/MinGW, git bash and WSL? Which should we support? Where are bashrc and bash_profile equivalents located?

See "How can I use a bash-like shell on Windows" for more details.
Also: "Launching a daemon from WSL"

If you have any insight on how to solve these challenges, please comment below or join our #cross-platform channel on Discord. ❤️

from fig.

MystPi avatar MystPi commented on July 21, 2024 9

Honestly I mostly just use Powershell; not WSL or Git Bash.

from fig.

mschrage avatar mschrage commented on July 21, 2024 7

What is the unix-like environment you use on Windows most often?

I'm assuming WSL, but I could be completely wrong.

from fig.

SJanJan avatar SJanJan commented on July 21, 2024 6

super work

from fig.

felix-berlin avatar felix-berlin commented on July 21, 2024 6

I can hardly wait!

from fig.

ayr-ton avatar ayr-ton commented on July 21, 2024 6

Maybe the best approach for this one is trying to write an app like https://github.com/microsoft/terminal/tree/main/samples that consumes the new Windows Console APIs.
Support for zsh/bash/fish first via WSL and Windows Console APIs could be a good MVP. Powershell in MVP 2.

from fig.

TheOnlyTails avatar TheOnlyTails commented on July 21, 2024 6

I actually almost never use WSL, I use Git Bash (via Windows Terminal), with Zsh installed on top of it.

from fig.

ionut-botizan avatar ionut-botizan commented on July 21, 2024 6

Terminal: Windows Terminal
Default Shell: Powershell Core (Not sure if it matters, but a heads up: there's the default, older version of Powershell and there's Powershell Core, which is the better, open source version, that also runs on Linux and MacOS)
*Nix env: WSL Ubuntu with Bash/Fish (but I rarely need it)

-- Used Cygwin in the past (feels like a lifetime ago)
-- Never understood why Git Bash even exists

from fig.

pcgeek86 avatar pcgeek86 commented on July 21, 2024 5

The "Hyper" terminal from Vercel runs on Windows as well as MacOS. It'd be great to see Fig work with Hyper on Windows 11, at least, even if Windows Terminal integration doesn't work yet.

from fig.

kidsamort avatar kidsamort commented on July 21, 2024 5

I also always use Git Bash

from fig.

jacobra19 avatar jacobra19 commented on July 21, 2024 3

Commenting to get updates - it's really useful, I hope to see a Windows release soon!

you could just click on the 'watch' button at the top

from fig.

levrik avatar levrik commented on July 21, 2024 3

@mschrage
I think UNIX domain sockets are available on Windows: https://devblogs.microsoft.com/commandline/af_unix-comes-to-windows/
I don't know if the implementation is more complete nowadays or if it's still lacking the missing features mentioned in the linked article. I also don't know which features you need so the implementation might be enough for your usecase.

from fig.

ntindle avatar ntindle commented on July 21, 2024 3

Regarding #1 in the list above, it may be worthwhile to add native support to windows terminal rather than have it be an accessibility hack

from fig.

RyKilleen avatar RyKilleen commented on July 21, 2024 3

Here's the master feature list for extensions on Windows Terminal.

microsoft/terminal#4000

As far as I can tell, the command palette is fully extensible but doesn't provide the sort of inline support you're probably looking for. They seem very open to feature requests though

from fig.

jasonwashburn avatar jasonwashburn commented on July 21, 2024 3

from fig.

BasixKOR avatar BasixKOR commented on July 21, 2024 2

I think winpty could be a great starting point for pseudo-console implementation. It is known to work well with other UNIX-like software as well.

from fig.

mschrage avatar mschrage commented on July 21, 2024 2

@levrik I didn't know about that Windows had added support for AF_UNIX socket networking. That's awesome.

@BasixKOR I will look into winpty! Our pseudoterminal is written in Rust, so we'll need to figure the right approach / library.

@ntindle does Windows Terminal have support for GUI plugins like Fig? If you have any links to documentation on this or thoughts on how to implement native support, please let me know.

from fig.

sergiubacioiu avatar sergiubacioiu commented on July 21, 2024 2

Please consider adding support for Tabby on Windows.
https://tabby.sh/

from fig.

resonancedesigns avatar resonancedesigns commented on July 21, 2024 2

WSL when using VS Code terminal, Git Bash otherwise.

from fig.

mschrage avatar mschrage commented on July 21, 2024 2

Good eye @florian-lefebvre!

@levrik To answer your question: yes, we use Rust! 🦀

from fig.

syedfaizan avatar syedfaizan commented on July 21, 2024 1

I use Cmder, works really well.

from fig.

hxse avatar hxse commented on July 21, 2024 1

Hope to support alacritty.

from fig.

levrik avatar levrik commented on July 21, 2024 1

@mschrage And few hours later I received your newsletter mentioning usage of Rust for at least your CLI 😅

from fig.

digeomel avatar digeomel commented on July 21, 2024

I understand that Windows terminal support is not done yet, but I'm a bit confused about vscode on Windows, because your README writes that it works on vscode terminal. I assume it only works on vscode terminal on MacOS, right?

from fig.

mschrage avatar mschrage commented on July 21, 2024

@digeomel that's exactly right. Fig supports VSCode, but only on macOS.

@pcgeek86 Same thing for Hyper.

from fig.

Lioness100 avatar Lioness100 commented on July 21, 2024

I always use git bash :)

from fig.

joshuajeschek avatar joshuajeschek commented on July 21, 2024

I also use Tabby, which is written in TypeScript and allows for plugins - a Tabby Plugin would be fantastic!

from fig.

levrik avatar levrik commented on July 21, 2024

@mschrage Wow. Is Fig written in Rust? This r#type looks very familiar. Also seeing a .cargo-lock file in the directory.

from fig.

florian-lefebvre avatar florian-lefebvre commented on July 21, 2024

@levrik Looking at the executable icon, it's a tauri app (https://github.com/tauri-apps/tauri) so yes it's built with Rust.

from fig.

MichaelBell avatar MichaelBell commented on July 21, 2024

Fig looks very interesting, would be great to see this working with PuTTY on Windows too.

from fig.

sasial-dev avatar sasial-dev commented on July 21, 2024

Could we lock this issue to the fig team only (for updates) and then create a discussion post for this issue for discussion on it?

from fig.

mschrage avatar mschrage commented on July 21, 2024

Good idea @sasial-dev and thanks for moving the conversation in a more constructive direction @haltcase.

I’ll lock this issue for now.

from fig.

mschrage avatar mschrage commented on July 21, 2024

The team just hit another milestone!

windows_demo.mp4

This is a really rough version of autocomplete running on Windows. Still more work to be done, but we're getting there! 🙌

from fig.

sullivan-sean avatar sullivan-sean commented on July 21, 2024

We're rolling out a closed alpha/prototype of Fig on Windows to a few users in the next week or so -- if you're on Windows and interested in getting early access, fill out the typeform here: https://withfig.typeform.com/to/n58Z7ciy

from fig.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.