Closed saifazmi closed 2 years ago
Hey @saifazmi! Thanks for the detailed bug report.
Can you run the follow commands?
ls -l@ ~/Library/LaunchAgents/
ls -l@ /var/tmp/fig/root/fig.socket
. I want to check the permissions on these files.ls -l@ /var/tmp/fig
fig diagnostic
Finally, is the Fig app running? (Do you see the Fig icon in the menubar)
I think you might need to run sudo rm -rf /var/tmp/fig
. It looks Fig was launched as root(?) and created a folder in /var/tmp/ that it cannot edit when launched normally.
@mschrage here are the outputs of the commands.
┌─╼[~]
└────╼ ls -l@ ~/Library/LaunchAgents/
total 64
...
-rw-r--r-- 1 saif staff 1005 23 Mar 21:06 io.fig.dotfiles-daemon.plist
-rw-r--r-- 1 saif staff 350 23 Mar 20:51 io.fig.launcher.plist
-rw-r--r-- 1 saif staff 510 23 Mar 20:51 io.fig.uninstall.plist
┌─╼[~]
└────╼ ls -l@ /var/tmp/fig/root/fig.socket
ls: /var/tmp/fig/root/fig.socket: No such file or directory
┌─╼[~]
└╼ ls -l@ /var/tmp/fig
total 0
drwxr-xr-x 3 saif wheel 96 23 Mar 21:04 saif
┌─╼[~]
└────╼ fig diagnostic
# Fig Diagnostics
## Fig details:
- Fig version: Version 1.0.56 (B416) [U.S.]
- Bundle path: /Applications/Fig.app
- Autocomplete: true
- Settings.json: true
- Accessibility: true
- Number of specs: 0
- Symlinked dotfiles: false
- Only insert on tab: false
- Keybindings path:
- Installation Script: true
- PseudoTerminal Path: /opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/saif/.local/bin:/Users/saif/.fig/bin:/Users/saif/.local/bin:/Users/saif/.local/bin
- SecureKeyboardInput: false
- SecureKeyboardProcess: <none>
## Hardware Info:
- Model Name: Mac mini
- Model Identifier: Macmini9,1
- Chip: Apple M1
- Cores: 8 (4 performance and 4 efficiency)
- Memory: 16 GB
## OS Info:
- macOS 12.3.0 (21E230)
## Environment:
- User Shell: /bin/zsh
- Current Directory: /Users/saif
- CLI Installed: true
- Executable Location: /Users/saif/.local/bin/fig
- Current Window ID: 17953/% (com.googlecode.iterm2)
- Active Process: zsh (65407) - /dev/ttys001
- Environment Variables:
- TERM_SESSION_ID=w0t0p0:6B674CE3-AE99-4D91-AB2D-194EE18D2396
- PATH=/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/saif/.local/bin:/Users/saif/.fig/bin:/Users/saif/.local/bin:/Users/saif/.local/bin
- TERM=xterm-256color
- FIG_INTEGRATION_VERSION=8
- FIG_TERM=1
- FIG_TERM_VERSION=4.3.0
## Integrations:
- SSH: false
- TMUX: false
- iTerm: installed!
- Hyper: application is not present.
- Visual Studio Code: Extension is not installed.
- Docker: false
Yes the fig app is running, see the following screenshot:
From the output of ls -l@ /var/tmp/fig
it doesn't look like the file is owned by root. If anything it seems to be owned by the right user:
┌─╼[~]
└────╼ ls -l@ /var/tmp/fig/saif/fig.socket
srwxr-xr-x 1 saif wheel 0 23 Mar 21:04 /var/tmp/fig/saif/fig.socket
Can you type "git com" and then take another screenshot of the debugger?
Does autocomplete appear for you?
I do not see the autocomplete:
And here's the proof of the behaviour I described in my initial post, I have purposefully used the gibberish command to highlight that sudo has no impact on the issue/behaviour. The pattern seems be that there needs to be anything before the fig command.
This seems like a different issue from the daemon socket not existing.
It seems like your custom prompt may be confusing Fig. Can you share your zshrc/zprofile?
Also try commenting out all non-Fig configuration from your zshrc and see if that resolves the issue? (This will help us isolate where the problem is coming from).
Hey @saifazmi just want to follow up here. I think the underlying issue is that Fig is not able to determine the text you've typed in the terminal because of the prompt you have configured.
I'd love to get this fixed! If you can share more details about which prompt you are using that would be very helpful! :)
Hey @mschrage I'm using:
zsh
as shelloh-my-zsh
Can you try switching to the default “robbyrussell" theme and see if that resolves the issue? (This will narrow down the bug to something related to your theme)
Can confirm that the default theme works fine with fig
I think that the issue may have to do with the %~%
sequence here: https://github.com/saifazmi/dotfiles/blob/2c500b72551da5322f651991fdc8c58855a2e6d0/.oh-my-zsh/themes/classyTouch.zsh-theme#L5
I think it should be replaced with %~
as it doesn't seem like %~%
is a valid prompt expansion.
https://zsh.sourceforge.io/Doc/Release/Prompt-Expansion.html
Previous version:
local current_dir='%{$fg[red]%}[%{$reset_color%}%~% %{$fg[red]%}]%{$reset_color%}'
Updated it to the following two variations and still doesn't work:
local current_dir='%{$fg[red]%}[%{$reset_color%}%~%{$fg[red]%}]%{$reset_color%}'
local current_dir='%{$fg[red]%}[%{$reset_color%}%~ %{$fg[red]%}]%{$reset_color%}'
I investigated this a little more. On my machine I'm able to reproduce the issue and it seems like fig
will correctly pop up with suggestions after a failed command that exits with nonzero status code. The easiest way to test this was to run false
, and on the next line suggestions are correct. If you run true
, however, the suggestions will be incorrect.
It seems like the prompt uses conditional prompt expansion of the form %(x.true-text.false-text)
and for some reason the true-text
is breaking fig
. What is weird is that if I set the prompt to just the true-text
Fig works just fine.
If you don't mind having the same prompt for when commands exit successfully vs not then one fix would be to just update the prompt to be just the true-text
or false-text
.
This is definitely a bug on our end though and I will continue to look into it
This issue has been automatically closed because there has been no activity for 14 days.
Description:
This is a really weird issue.
fig
does not work on terminal launch, here's thefig doctor
output, sorry for all the doctor commands buts its important to explain my findings.After the third doctor command below,
fig
starts to work as expected. The difference is that the thirdfig doctor
is being run assudo
and even though the command says thatRunning doctor as root is not supported.
that seems to be inconsequential, as when I go on to run the subsequent commandsudo fig doctor --verbose
the autocomplete feature starts to work (it will suggest the --verbose flag itself, and I also tested with cd and others)After a few minutes, again it will stop working, and if you run any sudo fig command, it will start working as expected, and the pattern repeats.
NOTES:
sudo
command doesn't matter, i.e. it doesn't need to be the third command.doctor
command, it can for example be this:sudo fig update
and it will have the same behaviour as above. BTW the output of the update command is:Unable to Connect to Fig: Fig might not be running to launch Fig run: fig launch
$ clear
orCtrl + L
) also seems to make fig stop workingDetails:
fig diagnostic
# Fig Diagnostics ## Fig details: - Fig version: Version 1.0.56 (B416) [U.S.] - Bundle path: /Applications/Fig.app - Autocomplete: true - Settings.json: true - Accessibility: true - Number of specs: 0 - Symlinked dotfiles: false - Only insert on tab: false - Keybindings path: - Installation Script: true - PseudoTerminal Path: /opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/saif/.local/bin:/Users/saif/.fig/bin:/Users/saif/.local/bin:/Users/saif/.local/bin - SecureKeyboardInput: false - SecureKeyboardProcess:
## Hardware Info:
- Model Name: Mac mini
- Model Identifier: Macmini9,1
- Chip: Apple M1
- Cores: 8 (4 performance and 4 efficiency)
- Memory: 16 GB
## OS Info:
- macOS 12.3.0 (21E230)
## Environment:
- User Shell: /bin/zsh
- Current Directory: /Users/saif
- CLI Installed: true
- Executable Location: /Users/saif/.local/bin/fig
- Current Window ID: 17953/% (com.googlecode.iterm2)
- Active Process: zsh (65407) - /dev/ttys001
- Environment Variables:
- TERM_SESSION_ID=w0t0p0:6B674CE3-AE99-4D91-AB2D-194EE18D2396
- PATH=/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/saif/.local/bin:/Users/saif/.fig/bin:/Users/saif/.local/bin:/Users/saif/.local/bin
- TERM=xterm-256color
- FIG_INTEGRATION_VERSION=8
- FIG_TERM=1
- FIG_TERM_VERSION=4.3.0
## Integrations:
- SSH: false
- TMUX: false
- iTerm: installed!
- Hyper: application is not present.
- Visual Studio Code: Extension is not installed.
- Docker: false