flathub / com.visualstudio.code

https://flathub.org/apps/details/com.visualstudio.code
136 stars 68 forks source link

I have to login with Github on every launch for sync to work. #426

Open DeepDoge opened 11 months ago

DeepDoge commented 11 months ago

I have to login with Github on every launch for Copilot, and VSCode's Sync to work.

Might be related: StackOverflow - "Sign in to GitHub" prompt to enable GitHub Copilot on every VS Code launch

miguelfito commented 10 months ago

Same problem here! 🤚🏼 It's annoying! 😭

driedpampas commented 10 months ago

Same problem :sob: :sob: image

karuboniru commented 9 months ago

Edit ~/.vscode/argv.json Add "password-store": "gnome" to the file If you are not using gnome or simliar desktop refer to https://code.visualstudio.com/docs/editor/settings-sync#_recommended-configure-the-keyring-to-use-with-vs-code

colorfulmoth commented 8 months ago

@karuboniru Attempted to do that, but it seems that the option password-store is disabled. The option has no effect

image

Aside from that, after some testing found out that it does work when passed as an argument when launching the flatpak like this

flatpak run com.visualstudio.code --password-store="gnome"

karuboniru commented 8 months ago

Attempted to do that, but it seems that the option password-store is disabled. The option has no effect

I believe it is false alarm since the option in file worked for me.

jurf commented 8 months ago

Did not help for me. Tried as a CLI argument and in argv.json. Always get a hang on activating Copilot, on a kill and relaunch it wants the password again. Output shows it correctly finds the configuration, even without any help, so it can be a related but different issue.

jurf commented 8 months ago

Using --password-store="basic" works, so I guess that is the workaround for me currently unfortunately. Might be tied to the OS? I'm running Fedora Silverblue 39 with GNOME.

jurf commented 8 months ago

Okay, this is very strange. Now I can use --password-store="gnome" and it works, but if I omit it completely, VSCode always hangs (even though, according to the output, it chooses the same store).

CheariX commented 7 months ago

I needed to sign in once with --password-store="basic". After that, it worked for my in any case, i.e. with --password-store="gnome" and even without any additional parameter. Strange...

oryband commented 6 months ago

Using "basic" password option is a security vulnerability https://code.visualstudio.com/docs/editor/settings-sync#_not-recommended-configure-basic-text-encryption

djfjeff commented 6 months ago

The issue is still present today, have to log in to Github every time I restart VScode. Tried all the workaround and nothing works.

DeepDoge commented 6 months ago

I ended up changing to Bluefin image of Fedora Silverblue. It has non-flatpak vscode built-in with distrobox, so idk if the issue still exists.

m-fariz-a commented 5 months ago

Yes, the issue is still exist

mdrokz commented 4 months ago

Im having the same issue with fedora silverblue 39 is there any update to this ?

DeepDoge commented 4 months ago

Im having the same issue with fedora silverblue 39 is there any update to this ?

just use the bluefin image, or install it inside a distrobox, but i think silverblue has toolbox by default you can use it i guess

then you can just run it from command line or create a .desktop file, or if you are using distrobox you can use the built in distrobox-export command. i would also set a different home folder for the distrobox, so random vscode related (.) directories or files doesn't end up in my home folder root. i use ~/Pods/vscode as my vscode's home folder. you can also link dconf inside the vscode's home folder, so it can see your gnome theme and if your system in dark or light mode and etc.

m-fariz-a commented 4 months ago

Im having the same issue with fedora silverblue 39 is there any update to this ?

I just layer vscode using rpm ostree. I know this is not the best method, but at least all the issues gone.

mdrokz commented 4 months ago

Im having the same issue with fedora silverblue 39 is there any update to this ?

just use the bluefin image, or install it inside a distrobox, but i think silverblue has toolbox by default you can use it i guess

* create an Ubuntu toolbox/distrobox

* install vscode in it

* also install gnome keyring in it (this is for the same github login issue)

then you can just run it from command line or create a .desktop file, or if you are using distrobox you can use the built in distrobox-export command. i would also set a different home folder for the distrobox, so random vscode related (.) directories or files doesn't end up in my home folder root. i use ~/Pods/vscode as my vscode's home folder. you can also link dconf inside the vscode's home folder, so it can see your gnome theme and if your system in dark or light mode and etc.

im using toolbox from beginning and i had installed gnome-keyring and libsecret and for some reason its still not working i followed all the steps that you mentioned

DeepDoge commented 4 months ago

@mdrokz it might require different steps on toolbox maybe? i use distrobox. gonna check it out when i have time.

jurf commented 4 months ago

Okay, this is very strange. Now I can use --password-store="gnome" and it works, but if I omit it completely, VSCode always hangs (even though, according to the output, it chooses the same store).

Yeah, I am pretty sure this just influences the race condition but does not fix it, it still hangs sometimes. The only proper workaround for me was to use --password-store="basic".

mdrokz commented 4 months ago

@mdrokz it might require different steps on toolbox maybe? i use distrobox. gonna check it out when i have time.

Yeah maybe thanks if you figure it out let us know :) I will also try to find a solution.

DeepDoge commented 4 months ago

@mdrokz Ok, I checked.

For toolbox:

This automatically used the image fedora-toolbox:38 to create the container for me.

Also had to install libsecret:

sudo dnf install libsecret

And done, it works. Just make sure everything is installed. GitHub login works. When I close and reopen vscode, it stays logged in, as expected.

If you are not in the container you can start vscode directly with:

toolbox run --container devbox code

But I have noticed an issue with toolbox: When vscode tries to open a link with the default browser nothing happens. This is a big issue because it both annoying and in order to login GitHub you have to cancel the login and "try with another method" 2 times until you get the login with https://github.com/login/device option. And I'm pretty sure this will cause other problems too.

So I found this issue on github: https://github.com/containers/toolbox/issues/291 I did these to fix the issue:

Then linked the flatpak-xdg-open in place of it.

sudo ln -s /usr/bin/flatpak-xdg-open /usr/bin/xdg-open

And now everything works!

Also as bonus, you can add this option to vscode settings json:

"window.titleBarStyle": "custom"

It will make the titlebar look nicer

mdrokz commented 4 months ago

@mdrokz Ok, I checked.

For toolbox:

  • I first created a toolbox with the name "devbox" you can name it anything else:
    toolbox create devbox

This automatically used the image fedora-toolbox:38 to create the container for me.

  • Then I entered the toolbox:

    toolbox enter devbox
  • Then i followed the vscode installation instructions for fedora on the vscode's site.

  • Then I installed the gnome-keyring (for github login to work on vscode):

    sudo dnf install gnome-keyring

Also had to install libsecret:

sudo dnf install libsecret

And done, it works. Just make sure everything is installed. GitHub login works. When I close and reopen vscode, it stays logged in, as expected.

If you are not in the container you can start vscode directly with:

toolbox run --container devbox code

But I have noticed an issue with toolbox: When vscode tries to open a link with the default browser nothing happens. This is a big issue because it both annoying and in order to login GitHub you have to cancel the login and "try with another method" 2 times until you get the login with https://github.com/login/device option. And I'm pretty sure this will cause other problems too.

So I found this issue on github: https://github.com/containers/toolbox/issues/291 I did these to fix the issue:

  • First entered the toolbox container

    toolbox enter devbox
  • Then installed the flatpak-xdg-utils

    sudo dnf install flatpak-xdg-utils
  • After that removed the xdg-open from /usr/bin/xdg-open (You can also move it to somewhere else instead)

    sudo rm -f /usr/bin/xdg-open

Then linked the flatpak-xdg-open in place of it.

sudo ln -s /usr/bin/flatpak-xdg-open /usr/bin/xdg-open

And now everything works!

Also as bonus, you can add this option to vscode settings json:

"window.titleBarStyle": "custom"

It will make the titlebar look nicer

Hi sorry for the late reply, yes I followed all of these steps in the toolbox before for some reason it isn't working for me, how did you install vscode in the toolbox ?

Also thanks for taking the time to find the browser fix I will try that.

DeepDoge commented 4 months ago

@mdrokz https://code.visualstudio.com/docs/setup/linux#_rhel-fedora-and-centos-based-distributions

What is the problem you're having exactly?

mdrokz commented 4 months ago

@mdrokz https://code.visualstudio.com/docs/setup/linux#_rhel-fedora-and-centos-based-distributions

What is the problem you're having exactly?

Hi @DeepDoge sorry for the late reply, I just restarted my PC and it seems to be working properly now thanks for all the help! I appreciate it.

francoism90 commented 3 months ago

I have the same issue again, it worked fine before. :/

Does anyone know a workaround? I open and close VSCode frequently, having to login every time isn't that fun.

sofrlachapelle commented 2 months ago

Enable MFA/2FA on your github account or whatever account you use to sync. Then, launch vscode once with: flatpak run com.visualstudio.code --password-store="basic" Or, open vscode then open the command pallet and search for "Configure Runtime Arguments". When argv.json opens, add the following at the bottom of the json object: "password-store": "basic" //Use basic text encryption. Screenshot from 2024-04-24 21-16-26

realitymolder commented 1 day ago

no official workaround by the team until now? same for other authed extensions