fzf-git.sh icon indicating copy to clipboard operation
fzf-git.sh copied to clipboard

Login Manager Infinte loop because of fzf-git

Open LORDyyyyy opened this issue 1 year ago • 2 comments

Yesterday I installed fzf-git and added the line source ~/fzf-git.sh in my .bashrc to enable it every time I open a terminal. This morning, I opened my PC normally just like every day, typing my password in the login manager, sddm, and got a login loop. After 4 hours of searching for the reason for this loop and how to fix it, I found nothing useful. I decided to revert anything I made yesterday, which was only fzf-git, I removed the line I wrote in .bashrc, and the problem was fixed. I solved the problem by sourcing the script only in interactive shell.

if [[ $- == *i* ]]; then
    source ~/fzf-git.sh
fi

It would be nice to add this simple block of code instead of just source ~/fzf-git.sh in fzf-git.sh README#installation for new users to avoid this issue.

LORDyyyyy avatar Aug 04 '24 12:08 LORDyyyyy

That's strange. Do you have the latest version of the file?

We do have a guard here:

https://github.com/junegunn/fzf-git.sh/blob/6df84d71fe8b532b6e1d7c4a754ea6c7c032f553/fzf-git.sh#L147-L148

Any idea why you're running into the problem?

junegunn avatar Aug 24 '24 07:08 junegunn

Yes it was my first time using fzf-git. I also tried switching from sddm to lighdm, but it didn't work too. I think the problem is associated with the X Server because when I started the X session manually, using the command xinit or startplasma-x11 in a tty, I passed the login loop and entered the system.

LORDyyyyy avatar Aug 31 '24 09:08 LORDyyyyy

I had a similar issue but my terminal would just crash, and sourcing it only as an interactive shell didn't work for me. Sourcing it as a prompt command fixed this issue for me

function load_fzf_git() {
   source ~/fzf-git.sh
}
PROMPT_COMMAND="load_fzf_git; $PROMPT_COMMAND"

hahnandrew avatar Dec 05 '24 20:12 hahnandrew

@hahnandrew That would make your shell unnecessarily reload the file over and over again.

I can't be 100% sure because I don't have the problem, but I believe 28b544a7b6d284b8e46e227b36000089b45e9e00 should help. Please update and leave comments if you still see the problem.

junegunn avatar Dec 06 '24 07:12 junegunn