Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate Autocomplete with Alacritty Terminal #28

Closed
brendanfalk opened this issue Jan 28, 2021 · 35 comments
Closed

Integrate Autocomplete with Alacritty Terminal #28

brendanfalk opened this issue Jan 28, 2021 · 35 comments
Labels
type:integration-request Request for an intergration with an existing tool

Comments

@brendanfalk
Copy link
Member

brendanfalk commented Jan 28, 2021

The title says it all.

Please subscribe to this issue to get an update when Fig's autocomplete integration with the Alacritty terminal is ready 😄

@brendanfalk brendanfalk added the type:integration-request Request for an intergration with an existing tool label Apr 8, 2021
@brendanfalk brendanfalk changed the title [INTEGRATION] Integrate Autocomplete with Alacritty Terminal Integrate Autocomplete with Alacritty Terminal Apr 8, 2021
@mschrage
Copy link
Member

Important note: Alacritty does not support tabs, so all that is required for the integration is some way of determining the cursor position.

@mschrage
Copy link
Member

mschrage commented Sep 2, 2021

Better late than never! Support for Alacritty is coming soon... 🤩

Screen Shot 2021-09-01 at 11 38 25 PM

@mschrage
Copy link
Member

This is landing in v1.0.49 (coming out in next day or two)!!!

@mschrage mschrage added this to the v1.0.49 milestone Sep 17, 2021
@Milo123459
Copy link

You guys never fail to amaze! 😌

@fwesss fwesss closed this as completed Sep 21, 2021
@sullivan-sean sullivan-sean reopened this Dec 17, 2021
@sullivan-sean
Copy link

We had to temporarily remove support for Alacritty due to issues with macOS Monterey. Luckily, we will be supporting it again soon.

Re-opening this for now for anyone who wants to subscribe for when we've re-integrated

@mschrage mschrage removed this from the v1.0.49 milestone Jan 27, 2022
@mschrage
Copy link
Member

mschrage commented Jan 27, 2022

A preview of the Alacritty integration is available. However, currently the integration is a bit tricky to setup which is why it is hidden by default.

Instructions:

  1. Run fig settings integrations.experimental true and then restart the Fig app
  2. Click the Fig menubar icon > Integrations > Alacritty > "Attempt to Install"
  3. Go to a terminal and run fig debug ime enable. A System Preferences window will appear and prompt you to install a third party Input Method.
  4. Run fig debug ime select
  5. Restart Alacritty and autocomplete should appear🤞

@Integralist
Copy link

Thanks @mschrage!

So interestingly, although I got the following error UI...

Screenshot 2022-01-28 at 09 57 28

It looks like it still worked fine 🤷🏻

Screenshot 2022-01-28 at 10 06 06

🎉 ❤️

@Integralist
Copy link

@mschrage I've just got a new MacBook Pro M1 and it seems the instructions above no longer apply 😞
Screenshot 2022-04-07 at 23 19 18

@mschrage
Copy link
Member

mschrage commented Apr 7, 2022

Did you restart Fig @Integralist ?

@Integralist
Copy link

OK that is working now.

It took...

  • Restart (x2, first time didn't indicate any difference, second time it did).
  • Install of Alacritty integration plugin (x2, first time failed).
  • Allow custom keyboard cursor (x2, first time failed).

@Integralist
Copy link

Integralist commented Apr 13, 2022

Just going to leave another update, which is it seems it's working BUT not when within a tmux shell.

Still debugging and will give an update if I find anything interesting.

EDIT: I have source-file ~/.fig/tmux at the bottom of my .tmux.conf file and the contents of ~/.fig/tmux is:

set-hook -ga window-pane-changed 'run-shell "fig bg:tmux #{pane_id}"'
#set-hook -ga session-windows-changed 'run-shell "fig bg:tmux #{pane_id}"'
set-hook -ga client-session-changed 'run-shell "fig bg:tmux #{pane_id}"'

# set-hook -ga client-detached run-shell 'run-shell "fig bg:tmux closed"'
set-hook -ga session-closed 'run-shell "fig bg:tmux '%'"'

UPDATE: I removed the following two lines from my .tmux.conf and found autocomplete would start working:

set -g default-terminal "screen-256color"
set -ga terminal-overrides ",*256col*:Tc"

But then I put them back and started a fresh Alacritty + tmux instance and things still worked 🤔

UPDATE 2: LOL. The Alacritty terminal + tmux instance that was just working, and I didn't do anything other than look at my email in my web browser has suddenly stopped working again. 🤷🏻‍♂️

UPDATE 3: I continued on, accepting fig wasn't working, when suddenly it started working again!? Happened after 5 minutes or so. In that time I compiled a Rust project and ran a tar command, not sure what magic voodoo caused it to come back to life though 🙂

@mschrage
Copy link
Member

@Integralist could be related to #1229?

@Integralist
Copy link

@mschrage I don't full screen my apps, so in this case that linked issue looks to be unrelated.

@mschrage
Copy link
Member

@Integralist can you run fig doctor and create a separate issue?

@clo4 clo4 closed this as completed Apr 22, 2022
@mschrage
Copy link
Member

Fig now fully supports Alacritty by default!

Run fig install --input method and follow the instructions to set it up.

@laffed
Copy link

laffed commented Nov 17, 2022

fig install --input-method

@chrisgrieser
Copy link

fig install --input-method is not working for me. Popup appears, but does not enable completions in alacritty

@digika-ding
Copy link

fig install --input-method is not working for me. Popup appears, but does not enable completions in alacritty

me too
OS: Ventrua 13.0.1
fig: 2.9.0
alacritty: 0.11.0

@mschrage
Copy link
Member

mschrage commented Dec 6, 2022

The new command is fig integrations install input-method

@chrisgrieser
Copy link

The new command is fig integrations install input-method

Still not working. The installation popup does appear:

Pasted image 2022-12-06 20 41 44

but after confirmation, there is no new input method registered by macOS. And there are no autocompletions at all in alacritty, even after restart.

Dashboard shows everything looking good, fig doctor gives me this, even though I have selected alacritty as my preferred terminal in the settings.

? Terminal support: Unsupported terminal, if you believe this is a mistake or would like to see support for your terminal, run `fig issue`
  __CFBundleIdentifier: <not-set>

@brendanfalk
Copy link
Member Author

@chrisgrieser This is a big ask, but have you tried restarting your computer? This usually fixes input method issues. The problem is with Apple. We do our best, but Apple's implementation of input method is known to be very finicky.

@digika-ding
Copy link

@brendanfalk
After reboot my mac still not working.

@chrisgrieser
Copy link

This is a big ask, but have you tried restarting your computer?

not that big an ask, all good!

I also tired restarting afterwards, and nothing changes, still not autocompletion, still nothing that has been added as input method

@chrisgrieser
Copy link

ah, I just found something:
Fig autocompletion works if you are launching alacritty via the Alacritty.app. It does not work if you launch alacritty via some app that calls the alacritty binary.

Unfortunately, you cannot simply replace the latter with the former, since the binary supports options like --working-directory to launch alacritty in a certain directory, something you cannot do with the Alacritty.app

@mschrage
Copy link
Member

mschrage commented Dec 8, 2022

@chrisgrieser can you run env in an Alacritty session launched directly from the binary?

@Integralist
Copy link

Not going to open a new issue for this but will say that for the longest time fig has just not worked with Alacritty as far as the 'position' of the autocomplete menu. To be clear: I do get autocomplete but the drop-down is always miles away from the actual prompt on screen (see screenshot below for an example, see if you can find the autocomplete drop-down).

Screenshot 2022-12-08 at 09 22 21

@Integralist
Copy link

Oh, and that position was only from a few days ago. Before that, for the longest time (I honestly couldn't say how long exactly), the drop-down would appear on the far right-side of the screen (mostly top-right).

@digika-ding
Copy link

Not going to open a new issue for this but will say that for the longest time fig has just not worked with Alacritty as far as the 'position' of the autocomplete menu. To be clear: I do get autocomplete but the drop-down is always miles away from the actual prompt on screen (see screenshot below for an example, see if you can find the autocomplete drop-down).

Screenshot 2022-12-08 at 09 22 21

@Integralist
Can you post your fig details?

@Integralist
Copy link

@digika-ding

Running fig doctor reports no issues, and running fig diagnostic reports:

fig-details:
  - 2.9.0-beta.5
hardware-info:
  - model: 
  - model-id: 
  - chip-id: Apple M1 Pro
  - cores: 8
  - mem: 16.00 GB
os-info:
  - macOS 13.0.1 (22A400)
environment:
  - shell: /opt/homebrew/Cellar/zsh/5.9/bin/zsh
  - terminal: alacritty
  - cwd: /Users/integralist/Code/test-projects/testing-cli-projects
  - exe-path: /Users/integralist/.fig/bin/fig
  - install-method: unknown
  - env-vars:
    - DISPLAY: /private/tmp/com.apple.launchd.F66qL9mL1l/org.xquartz:0
    - FIGTERM_SESSION_ID: 1424db57-596c-44f6-ad33-6094494ecb2a
    - FIG_HOSTNAME: D3496LK9V7
    - FIG_PID: 13615
    - FIG_SET_PARENT: 1424db57-596c-44f6-ad33-6094494ecb2a
    - FIG_SET_PARENT_CHECK: 1
    - FIG_TERM: 2.9.0-beta.5
    - PATH: /Users/integralist/.yarn/bin:/Users/integralist/.config/yarn/global/node_modules/.bin:/Users/integralist/.goenv/versions/1.18.5/bin:/Users/integralist/.goenv/bin:/Users/integralist/Library/Caches/fnm_multishells/13747_1670491302573/bin:/Users/integralist/bin:/opt/homebrew/opt/ruby/bin:/Users/integralist/.cargo/bin:/Users/integralist/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/integralist/.yarn/bin:/Users/integralist/.config/yarn/global/node_modules/.bin:/Users/integralist/.goenv/shims:/Users/integralist/Library/Caches/fnm_multishells/1241_1669889671084/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/integralist/.fig/bin:/Users/integralist/.local/bin:/opt/homebrew/opt/fzf/bin:/Users/integralist/go/1.18.5/bin
    - SHELL: /opt/homebrew/bin/zsh
    - TERM: xterm-256color
    - __CFBundleIdentifier: io.alacritty

@Integralist
Copy link

Well. Looks like I should have asked sooner 🤦🏻 because seeing in the above diagnostics install-method: unknown I decided to scroll back up this thread and run fig integrations install input-method which then asked me to restart my terminal, and since doing that it appears the autocomplete drop-down is starting to appear where it should be 🎉

@digika-ding
Copy link

digika-ding commented Dec 8, 2022

@Integralist

@digika-ding

Running fig doctor reports no issues, and running fig diagnostic reports:

fig-details:
  - 2.9.0-beta.5
hardware-info:
  - model: 
  - model-id: 
  - chip-id: Apple M1 Pro
  - cores: 8
  - mem: 16.00 GB
os-info:
  - macOS 13.0.1 (22A400)
environment:
  - shell: /opt/homebrew/Cellar/zsh/5.9/bin/zsh
  - terminal: alacritty
  - cwd: /Users/integralist/Code/test-projects/testing-cli-projects
  - exe-path: /Users/integralist/.fig/bin/fig
  - install-method: unknown
  - env-vars:
    - DISPLAY: /private/tmp/com.apple.launchd.F66qL9mL1l/org.xquartz:0
    - FIGTERM_SESSION_ID: 1424db57-596c-44f6-ad33-6094494ecb2a
    - FIG_HOSTNAME: D3496LK9V7
    - FIG_PID: 13615
    - FIG_SET_PARENT: 1424db57-596c-44f6-ad33-6094494ecb2a
    - FIG_SET_PARENT_CHECK: 1
    - FIG_TERM: 2.9.0-beta.5
    - PATH: /Users/integralist/.yarn/bin:/Users/integralist/.config/yarn/global/node_modules/.bin:/Users/integralist/.goenv/versions/1.18.5/bin:/Users/integralist/.goenv/bin:/Users/integralist/Library/Caches/fnm_multishells/13747_1670491302573/bin:/Users/integralist/bin:/opt/homebrew/opt/ruby/bin:/Users/integralist/.cargo/bin:/Users/integralist/go/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/integralist/.yarn/bin:/Users/integralist/.config/yarn/global/node_modules/.bin:/Users/integralist/.goenv/shims:/Users/integralist/Library/Caches/fnm_multishells/1241_1669889671084/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/integralist/.fig/bin:/Users/integralist/.local/bin:/opt/homebrew/opt/fzf/bin:/Users/integralist/go/1.18.5/bin
    - SHELL: /opt/homebrew/bin/zsh
    - TERM: xterm-256color
    - __CFBundleIdentifier: io.alacritty

Thank you for your share. What's your alacritty version?

@Integralist
Copy link

Don't get me wrong, it's not "great"...

Screenshot 2022-12-08 at 10 26 01

But it seems to correct itself when you keep typing...

Screenshot 2022-12-08 at 10 26 09

@Integralist
Copy link

Thank you for your share. What's your alacritty version?

0.10.1

I can see there is now 0.11.0 so I'm going to bump to that shortly too.

@digika-ding
Copy link

Thank you for your share. What's your alacritty version?

0.10.1

I can see there is now 0.11.0 so I'm going to bump to that shortly too.

#2126
Maybe It's a bad idea to upgrade alacritty.

@chrisgrieser
Copy link

@mschrage
here is the output of env from the Alacritty.app and from the binary
app.txt
binary.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:integration-request Request for an intergration with an existing tool
Projects
None yet
Development

No branches or pull requests

10 participants