fig
fig copied to clipboard
Pasting large commands of text into fig enabled fish terminal breaks CLI
Description:
Please include a detailed description of the issue (and an image or screen recording, if applicable)
When pasting large amounts of text into a fish terminal window, the CLI input bugs out and does not enable me to execute the command.
I have not found any way to recover the terminal session, so generally I just kill it if this happens.
If I disable the fig init scripts in ~/.config/fish/conf.d/00_fig_pre.fish and 99_fig_post.fish I can paste long commands fine:
Details:
macOS | Fig | Shell |
---|---|---|
12.4.0 | Version 1.0.59 (B493) | /opt/homebrew/bin/fish |
fig diagnostic
Version 1.0.59 (B493) [Beta] [Australian] UserShell: /opt/homebrew/bin/fish Bundle path: /Applications/Fig.app Autocomplete: true Settings.json: true CLI installed: true CLI tool path: /Users/ross/.fig/bin/fig Accessibility: true SSH Integration: false Tmux Integration: false iTerm Integration: true [Authenticated] Hyper Integration: false VSCode Integration: true Docker Integration: false Symlinked dotfiles: false Only insert on tab: false UNIX Socket Exists: true Installation Script: true PseudoTerminal Path: /Users/ross/.asdf/installs/python/3.10.4/bin:/Users/ross/.asdf/installs/direnv/2.31.0/bin:/Users/ross/.asdf/installs/packer/1.8.0/bin:/Users/ross/.asdf/installs/nomad/1.2.6/bin:/Users/ross/.asdf/installs/vault/1.10.0 ent/bin:/Users/ross/.asdf/installs/java/corretto-17.0.3.6.1/bin:/Users/ross/.asdf/installs/deno/1.23.1/bin:/Users/ross/.asdf/installs/deno/1.23.1/.deno/bin:/Users/ross/.asdf/installs/tflint/0.38.1/bin:/Users/ross/.asdf/shims:/opt/homebrew/opt/asdf/libexec/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/ross/.local/bin:/opt/homebrew/opt/fzf/bin:/Users/ross/.fig/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Wireshark.app/Contents/MacOS SecureKeyboardInput: false SecureKeyboardProcess:Current active process: fish (60245) - /dev/ttys004 Current terminal session: w1t0p0:18C0714D-5B7F-4046-B15A-D8EE1BC1AF8E Current working directory: /Users/ross Current window identifier: 10751/% (com.googlecode.iterm2)
Hey @rcousens! What version of fish are you using? (Run fish --version
)
Can you try to reproduce in a different shell?
Hey @rcousens, seems like this might have been a bug on the beta, can you try updating and see if you still have the issue.
@grant0417 Thanks, I'll test now!
## Fig details:
- Fig version: Version 1.0.60 (B501) [Beta] [Australian]
- 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: /Users/ross/.asdf/installs/python/3.10.4/bin:/Users/ross/.asdf/installs/direnv/2.31.0/bin:/Users/ross/.asdf/installs/packer/1.8.0/bin:/Users/ross/.asdf/installs/nomad/1.2.6/bin:/Users/ross/.asdf/installs/vault/1.10.0+ent/bin:/Users/ross/.asdf/installs/java/corretto-17.0.3.6.1/bin:/Users/ross/.asdf/installs/deno/1.23.1/bin:/Users/ross/.asdf/installs/deno/1.23.1/.deno/bin:/Users/ross/.asdf/installs/tflint/0.38.1/bin:/Users/ross/.asdf/shims:/opt/homebrew/opt/asdf/libexec/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/ross/.local/bin:/opt/homebrew/opt/fzf/bin:/Users/ross/.fig/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Wireshark.app/Contents/MacOS
- SecureKeyboardInput: false
- SecureKeyboardProcess: <none>
## Hardware Info:
- Model Name: MacBook Pro
- Model Identifier: MacBookPro18,1
- Chip: Apple M1 Pro
- Cores: 10 (8 performance and 2 efficiency)
- Memory: 32 GB
## OS Info:
- macOS 12.4.0 (21F79)
## Environment:
- User Shell: /opt/homebrew/bin/fish
- Current Directory: /Users/ross
- CLI Installed: true
- Executable Location: /opt/homebrew/bin/fig
- Current Window ID: 16394/% (com.googlecode.iterm2)
- Active Process: fish (24894) - /dev/ttys002
- Terminal: iterm
- Installed via Brew: true
- Environment Variables:
- TERM_SESSION_ID=w0t0p0:1F13316C-EB02-4B84-BDAF-51BE9650F2CF
- TERM=xterm-256color
- FIG_INTEGRATION_VERSION=8
- PATH=/Users/ross/.asdf/installs/python/3.10.4/bin:/Users/ross/.asdf/installs/direnv/2.31.0/bin:/Users/ross/.asdf/installs/packer/1.8.0/bin:/Users/ross/.asdf/installs/nomad/1.2.6/bin:/Users/ross/.asdf/installs/vault/1.10.0+ent/bin:/Users/ross/.asdf/installs/java/corretto-17.0.3.6.1/bin:/Users/ross/.asdf/installs/deno/1.23.1/bin:/Users/ross/.asdf/installs/deno/1.23.1/.deno/bin:/Users/ross/.asdf/installs/tflint/0.38.1/bin:/Users/ross/.asdf/shims:/opt/homebrew/opt/asdf/libexec/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Users/ross/.local/bin:/opt/homebrew/opt/fzf/bin:/Users/ross/.fig/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Wireshark.app/Contents/MacOS
- FIG_PID=24894
- FIG_TERM_VERSION=5.1.0
- FIG_TERM=1
## Integrations:
- SSH: false
- TMUX: false
- iTerm: installed!
- Hyper: application is not present.
- Visual Studio Code: installed!
- Docker: false
❯ fish --version
fish, version 3.5.1
no dice :(
I'll try reproducing in a different shell, though I'm guessing it'll probably be a fish only thing! 👍
How many are you pasting there? Also what fish plugins are you using?
@grant0417 Hrmm I can reproduce in bash, the behaviour is a little different though! It just freezes the CLI and doesn't show the pasted output.
1008 characters -> no problem. 1138 -> problem occurs.
Fish also exhibits the same behaviour, 1008 -> no problem, 1138 -> problem occurs.
Let me find the exact number for you.
The magic number is 1011. 1010 'a' works, 1011 'a' doesn't.
Fish plugins (though I don't think they are the culprit):
❯ fisher list
jorgebucaran/fisher
jethrokuan/z
franciscolourenco/done
wfxr/forgit
patrickf1/fzf.fish
jorgebucaran/autopair.fish
ilancosman/tide@v5
My initial testing involved disabling all plugins except for the fig pre/post.
I have a clue for you, I think bracketed paste mode is related. I can replicate the behaviour in numerous applications when fig is enabled (vim, nano, micro).
It's eating the end of bracketed paste mode somehow?
Additionally, I can recreate the issue in Alacritty and MacOS Terminal.app, but not WezTerm! Weird!
I disabled ALL my plugins (mv ~/.config/fish ~/.config/fish.backup), quit iTerm, reinstalled Fig (Fig -> Integrations -> Developer -> Run Install Script), opened iTerm and started a shell with fish, and then pasted more than 1012 characters to recreate the issue. So I'm confident it's not plugin related. It could be related to the version of fish (3.5.1), but I can confirm the problem happens with a clean install of Fish and Fig 1.0.60 (B508).
This should be easy to recreate and only happens when I'm in the binary "fish (figterm)" which gets launched by the 00_fig_pre.fish script.
FIG_CHECKED_PROMPTS 1
FIG_DOTFILES_SOURCED 1
FIG_HOSTNAME pasito.local
FIG_INTEGRATION_VERSION 8
FIG_IN_DOCKER 0
FIG_PID 75787
FIG_SHELL_PATH /opt/homebrew/Cellar/fish/3.5.1/bin/fish
FIG_TERM 1
FIG_TERM_VERSION 5.1.0
FIG_WORKFLOWS_KEYBIND \\cf
FISH_VERSION 3.5.1
Also, I think I am on to something with bracketed paste. Because if I type a lot of a's instead of PASTE a lot of a's then the problem doesn't occur:
1402 a's and no problem when holding down a for a minute.
Using Edit -> Paste Special -> Advanced Paste...
in iTerm is quite useful for testing. When I set Chunk Size
to a max of 4B, it seems to fix my issues.
@mpas97 Thanks, that's a useful work around! I had to set it to 4 bytes to get it to work (took about 3s to paste ~1200 a's). However, I still hope there is a permanent fix here!
I believe this should be fixed on beta, also setting the Chunk Size
to any number <1000 might work, so that would speed up the pasting.
@grant0417 I'll test beta now, thanks for working on this! I did try 256 and 16 chunk size (didn't change the delay between chunks) and both resulted in the bug.
## Fig details:
- Fig version: Version 1.0.60 (B509) [Beta] [Australian]
Error still there generally, but 4b chunk size fixes the issue. Anything over 4b and I still have the issue. At least I have a workaround for pasting certs and AWS creds in to my terminal. First two tests are 4b with different delays (made no difference, both worked). The last is 16b size with ~60ms delay between chunks.
Make sure to open a new terminal session after updating, will keep investigating this!
Problem still there with new iTerm2 and new terminal session (quit iTerm2, reopen, CMD-N for new terminal). Thanks for your persistence @grant0417. I haven't disabled fig generally yet because I love it so much, but I have a second setup with WezTerm for stuff where I need to paste!
I've now disabled fig permanently (by renaming the ~/.config/fish/conf.d/00_fish_pre.fish and 99_fish_post.fish scripts) until this is fixed as it has been making the terminal generally unusable for me. Otherwise, I love fig and appreciate all the hard work you guys are doing. Thank you!
I spend a while working out what is actually going on here, I believe the actual fix should be on beta soon (within the next couple hours).
So sorry once again @rcousens for the issue and thank you so much for your debugging on it!
I know this is the second time I have said this, but I very thoroughly tested this time (plus it was a very strange bug)
I've now disabled fig permanently (by renaming the ~/.config/fish/conf.d/00_fish_pre.fish and 99_fish_post.fish scripts) until this is fixed as it has been making the terminal generally unusable for me. Otherwise, I love fig and appreciate all the hard work you guys are doing. Thank you!
~~You don't need to do that, just rename the middle layer binary is okay for me.~~
2022-08-31 09:09:54 CST Edit: Correct a workaround, just do below can fix the bug in current release version.
mv $HOME/.fig/bin $HOME/.fig/bin.bak
Wow, it's fixed! THANK YOU @grant0417, I really appreciate your effort on resolving this. 👏 🙏 🥳
@ChowRex if you can confirm your use case is fixed then I will close this issue.
Wow, it's fixed! THANK YOU @grant0417, I really appreciate your effort on resolving this. 👏 🙏 🥳
@ChowRex if you can confirm your use case is fixed then I will close this issue.
I have tested again, correct my answer: rename the ~/.fig/bin
directory is a work around to fix this bug in current release version.
@grant0417 Hi, I'm very happy with the fix! Thanks again!
I'm going to close this issue as @ChowRex hasn't indicated he's still having issues either :)