withfig / fig

Public issue tracker for Fig.
https://fig.io
MIT License
2.06k stars 63 forks source link

Linux: Fig doesn't respect JSON autocomplete settings #1762

Open kjkent opened 2 years ago

kjkent commented 2 years ago

Sanity checks

Issue Details

Hello! And congrats on the recent Linux release -- I've been excited about this for a long time.

Description:

Fig's autocomplete keybindings behaviour has improved since the resolution of https://github.com/withfig/fig/issues/1758 (aside from keys having multiple bindings in the UI) ; however, the in-terminal window fails to follow the behavior set out by the settings JSON. The two may be linked, but the lack of duplication in the JSON makes me think this is its own issue. Even if the desktop app is responsible for interpreting the JSON rather than Figterm, I think it shouldn't override the written settings.

My settings.json is:

app.beta = true
app.hideMenubarIcon = true
app.launchOnStartup = true
app.preferredTerminal = "Alacritty"
autocomplete.firstTokenCompletion = true
autocomplete.keybindings.command+- = "ignore"
autocomplete.keybindings.command+= = "ignore"
autocomplete.keybindings.command+i = "ignore"
autocomplete.keybindings.control+- = "decreaseSize"
autocomplete.keybindings.control+= = "increaseSize"
autocomplete.keybindings.control+i = "toggleDescription"
autocomplete.keybindings.control+j = "ignore"
autocomplete.keybindings.control+k = "ignore"
autocomplete.keybindings.control+n = "ignore"
autocomplete.keybindings.control+p = "ignore"
autocomplete.keybindings.down = "navigateDown"
autocomplete.keybindings.enter = "insertSelectedAndExecute"
autocomplete.keybindings.shift+tab = "ignore"
autocomplete.keybindings.tab = "insertCommonPrefixOrNavigateDown"
autocomplete.keybindings.up = "navigateUp"
autocomplete.preferVerboseSuggestions = false
autocomplete.theme = "dracula"
integrations.experimental = true
plugins.beta = true

However, Fig shakes on tab and only inserts a selected autocomplete. This is on Fedora 36, on tmux running in Alacritty.

Note: In addition to this, Fig doesn't seem to save to settings.json reliably and ignores a change to the tab behaviour set during new user setup. This has improved since @rahulsarathy's work on https://github.com/withfig/fig/issues/1758; however, I created a new user account and wiped ~/.fig/ and ~/.zshrcand this time selected that tab should insert, rather than shake. However, this selection is ignored by the autocomplete window which still shakes, and the recreated settings.json is empty.

Environment

fig-details:
  - cli-version: 1.4.11
  - desktop-version: 2.3.17
  - figterm-version: 5.2.0
hardware-info:
  - chip-id: AMD Ryzen 5 3600 6-Core Processor
  - cores: 6
  - mem: 15903.723 GB
os-info:
  - kernel: 5.19.6-200.fc36.x86_64
  - distro: "Fedora Linux 36 (Thirty Six)"
  - distro-version: "36 (Thirty Six)"
environment:
  - shell: /usr/bin/zsh
  - terminal: <unknown>
  - cwd: /home/kjkent
  - exe-path: /usr/bin/fig
  - install-method: unknown
  - env-vars:
    - DISPLAY: :0
    - FIG_INTEGRATION_VERSION: 8
    - FIG_PID: 18767
    - FIG_TERM: 1
    - FIG_TERM_TMUX: 1
    - FIG_TERM_VERSION: 5.2.0
    - GLFW_IM_MODULE: ibus
    - GTK_IM_MODULE: ibus
    - PATH: /usr/lib64/ccache:/home/kjkent/.nvm/versions/node/v16.16.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/kjkent/.local/bin:/home/kjkent/.local/share/JetBrains/Toolbox/scripts:/home/kjkent/.fig/bin:/home/kjkent/.local/bin
    - QT_IM_MODULE: ibus
    - SHELL: /usr/bin/zsh
    - TERM: screen-256color
    - TERM_SESSION_ID: e0c298e0-91db-490d-8fa4-4ba688e21018
    - XDG_CURRENT_DESKTOP: KDE
    - XDG_SESSION_DESKTOP: KDE
    - XDG_SESSION_TYPE: x11
    - XMODIFIERS: @im=ibus
mac-h95 commented 2 years ago

I'm also experiencing this issue on macOS Monterey

ZoukiLi commented 2 years ago

I have the same problem with the fig keybinding setting on my Debian system. Modifying a setting with fig settings <key> <value> seems more reliable than open the json file. However, the keybinding setting is still not working. Not only does the bug holds for Tab and Enter, but for other non-preset keys as well. For me, ^j ^k ^r, etc, are all not working. I thought that may be caused by key conflicts, so I changed it to meta + j. But it doesn't take effect.

donmccurdy commented 1 year ago

Same issue here on macOS Ventura 13.0.1. Changing autocomplete-related settings in the Fig UI has no effect, even after restarting Fig, the shell, etc. Changing settings in the fig settings CLI works immediately. Happy to share more debugging details if helpful.