VSCode RPM and Flatpak cannot communicat...

I'm specifically having this problem: https://github.com/ansible/vscode-ansible/issues/1799
GitHub
VSCode RPM and Flatpak cannot communicate to vscode url handler for...
Summary I have tried 3 different browsers and the only way I have gotten it to authenticate is using both Visual Studio Code as an RPM and Firefox as an RPM. Ideally, I would like it to be able to ...
80 Replies
alexmeyer
alexmeyer2w ago
actually now I'm playing with it, and I'm able to open vscode:// links from my flatpak firefox into my native vscode just fine (not sure if a thread is what you meant by moving the convo but I figured it's something)
Noel
NoelOP2w ago
threading is fine. are you able to use ansible-lightspeed? that is where I'm specifically getting the behavior of it opening into a new window. authenticating to github and stuff works fine. it's the only plugin that is broken for me.
alexmeyer
alexmeyer2w ago
oh weird. I can try, I've never used that before
Noel
NoelOP2w ago
actually
alexmeyer
alexmeyer2w ago
yeah, it looks like I'd have to sign up for a ton of stuff to even be able to test that interaction... 😕
Noel
NoelOP2w ago
nevermind
alexmeyer
alexmeyer2w ago
oh?
Noel
NoelOP2w ago
it's screwing up for everything now.
alexmeyer
alexmeyer2w ago
ah, ok. from that github issue, did you end up messing with .desktop files? also my simple test was throwing something like vscode://ms-azuretools.vscode-docker in my browser and letting it try to open in vscode
Noel
NoelOP2w ago
it doesn't open it in the existing window it will open it in a completely new window and do nothing. ugh. This makes me want to quit using VScode
alexmeyer
alexmeyer2w ago
I'm trying to send a screen recording but discord is special. but mine opened in the existing window your vscode is layered/part of your image?
Noel
NoelOP2w ago
layered as part of my image. on Bazzite
alexmeyer
alexmeyer2w ago
yeah same
Noel
NoelOP2w ago
it used to work, I don't know what the hell happened.
alexmeyer
alexmeyer2w ago
just for grins, do a systemctl --user restart flatpak-session-helper.service
Noel
NoelOP2w ago
just opens a new window
alexmeyer
alexmeyer2w ago
and just to check, your only .desktop file is the one in /usr/share/applications? you don't have anything in ~/.local/share/applications?
Noel
NoelOP2w ago
I tried adding something in there to test and it didn't do anything. just removed it now. what does your .desktop file look like for vscode?
alexmeyer
alexmeyer2w ago
[Desktop Entry]
Name=Visual Studio Code
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=/usr/share/code/code %F
Icon=vscode
Type=Application
StartupNotify=false
StartupWMClass=Code
Categories=TextEditor;Development;IDE;
MimeType=application/x-code-workspace;
Actions=new-empty-window;
Keywords=vscode;

[Desktop Action new-empty-window]
Name=New Empty Window
Name[de]=Neues leeres Fenster
Name[es]=Nueva ventana vacía
Name[fr]=Nouvelle fenêtre vide
Name[it]=Nuova finestra vuota
Name[ja]=新しい空のウィンドウ
Name[ko]=새 빈 창
Name[ru]=Новое пустое окно
Name[zh_CN]=新建空窗口
Name[zh_TW]=開新空視窗
Exec=/usr/share/code/code --new-window %F
Icon=vscode
[Desktop Entry]
Name=Visual Studio Code
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=/usr/share/code/code %F
Icon=vscode
Type=Application
StartupNotify=false
StartupWMClass=Code
Categories=TextEditor;Development;IDE;
MimeType=application/x-code-workspace;
Actions=new-empty-window;
Keywords=vscode;

[Desktop Action new-empty-window]
Name=New Empty Window
Name[de]=Neues leeres Fenster
Name[es]=Nueva ventana vacía
Name[fr]=Nouvelle fenêtre vide
Name[it]=Nuova finestra vuota
Name[ja]=新しい空のウィンドウ
Name[ko]=새 빈 창
Name[ru]=Новое пустое окно
Name[zh_CN]=新建空窗口
Name[zh_TW]=開新空視窗
Exec=/usr/share/code/code --new-window %F
Icon=vscode
that's the one in usr/share
Noel
NoelOP2w ago
OK, so if I try to authenticate using the local server option for github it works. using just the browser gives me the same behavior. @alexmeyer so you are saying if you open vscode://ms-azuretools.vscode-docker in your flatpak browser, it will open in the same window as your rpm based vscode that you have open already? This is on Bazzite?
alexmeyer
alexmeyer2w ago
my cutom image based on bazzite, but yes. and I don't have anything fancy installed that'd change this aspect
Noel
NoelOP2w ago
Does it open any kind of thing like this?
No description
alexmeyer
alexmeyer2w ago
yup
Noel
NoelOP2w ago
what do you have in system handler? I wonder if something is messed up in there for me.
Noel
NoelOP2w ago
anything in here?
No description
alexmeyer
alexmeyer2w ago
alexmeyer
alexmeyer2w ago
there it goes
Noel
NoelOP2w ago
insane. something has got to be different on my system then. as you see in my github issue, it opens a whole new window. dumb idea, I'm going to try and create a new test user and see if it happens there.
alexmeyer
alexmeyer2w ago
No description
alexmeyer
alexmeyer2w ago
yeah, I saw that. and I remember having that issue when I was trying to use flatpak vscode, and that was such a nightmare I just ended up installing it natively in my custom image
Noel
NoelOP2w ago
so on a new profile
Noel
NoelOP2w ago
No description
Noel
NoelOP2w ago
I get this. selecting vscode opens a new window.
alexmeyer
alexmeyer2w ago
so same behavior even under a new user?
Noel
NoelOP2w ago
yup
alexmeyer
alexmeyer2w ago
that's wild
Noel
NoelOP2w ago
only it's not going to always choose the chosen app. I'm at a total loss.
alexmeyer
alexmeyer2w ago
really dumb question, you've rebooted recently, right? I only ask because I've done exactly that way too many times myself and a reboot was the simple fix and I somehow forgot to even try
Noel
NoelOP2w ago
yup several times
alexmeyer
alexmeyer2w ago
I figured, just had to ask. lol
Noel
NoelOP2w ago
never hurts
alexmeyer
alexmeyer2w ago
right
Noel
NoelOP2w ago
I wonder if it's a vscode version thing. or something with KDE.
alexmeyer
alexmeyer2w ago
are you installing it via microsoft's .repo file?
Noel
NoelOP2w ago
yup
alexmeyer
alexmeyer2w ago
same for me then same behavior if you try to xdg-open vscode://ms-azuretools.vscode-docker?
Noel
NoelOP2w ago
no in fact it opened correctly.
alexmeyer
alexmeyer2w ago
ah HA no idea what "ah ha", but ah ha!
Noel
NoelOP2w ago
LOL
alexmeyer
alexmeyer2w ago
something on the browser side then. weirdly enough flatpak firefox?
Noel
NoelOP2w ago
must be. yup from flathub
alexmeyer
alexmeyer2w ago
lol same 🙃
Noel
NoelOP2w ago
any changes with flatseal? maybe it can't see that directory or something? do you have flatpak-xdg-utils installed? I don't. it doesn't come by default, I tried that earlier.
alexmeyer
alexmeyer2w ago
nope
No description
alexmeyer
alexmeyer2w ago
only overrides are bazzite defaults and then two of my personal folders for opening html files in web project folders
No description
alexmeyer
alexmeyer2w ago
also this is what shows in firefox's applications settings
No description
Noel
NoelOP2w ago
I see one difference.
test@isengard:~$ flatpak override --show org.mozilla.firefox
[Context]
filesystems=!host-os;
unset-environment=LIBVA_DRIVER_NAME;LIBVA_MESSAGING_LEVEL;NVD_BACKEND;LIBVA_DRIVERS_PATH;MOZ_DISABLE_RDD_SANDBOX;

[Environment]
LIBVA_DRIVER_NAME=
LIBVA_MESSAGING_LEVEL=
MOZ_USE_XINPUT2=1
MOZ_ENABLE_WAYLAND=1
NVD_BACKEND=
LIBVA_DRIVERS_PATH=
MOZ_DISABLE_RDD_SANDBOX=
test@isengard:~$ flatpak override --show org.mozilla.firefox
[Context]
filesystems=!host-os;
unset-environment=LIBVA_DRIVER_NAME;LIBVA_MESSAGING_LEVEL;NVD_BACKEND;LIBVA_DRIVERS_PATH;MOZ_DISABLE_RDD_SANDBOX;

[Environment]
LIBVA_DRIVER_NAME=
LIBVA_MESSAGING_LEVEL=
MOZ_USE_XINPUT2=1
MOZ_ENABLE_WAYLAND=1
NVD_BACKEND=
LIBVA_DRIVERS_PATH=
MOZ_DISABLE_RDD_SANDBOX=
MOZ_ENABLE_WAYLAND=1 i don't see that in yours
alexmeyer
alexmeyer2w ago
hmm yeah
Noel
NoelOP2w ago
how would I disable that?
alexmeyer
alexmeyer2w ago
that'd be a wild difference to matter in this case umm
Noel
NoelOP2w ago
it's a difference. and that's what matters lol
alexmeyer
alexmeyer2w ago
flatpak override --unset-env=MOZ_ENABLE_WAYLAND org.mozilla.firefox should do it? oh there and then check the output of the show command again to make sure that worked worst case, you can always directly sudo vim /var/lib/flatpak/overrides/org.mozilla.firefox and just nuke that line
Noel
NoelOP2w ago
no change.
alexmeyer
alexmeyer2w ago
restarted firefox, right?
Noel
NoelOP2w ago
yup, no change.
alexmeyer
alexmeyer2w ago
really weird
Noel
NoelOP2w ago
yeah, I dunno makes me mad. I think I'm just going to switch to Zed and give up on VSCode. I wanted to set it up so it could be remotely accessible for my iPad but if I can't get extensions to work, it's like, what's the point?
alexmeyer
alexmeyer2w ago
right the fact this issue exists isn't completely surprising to me, but what is surprising is the fact that you have it and I don't
Noel
NoelOP2w ago
yeah, it's bizarre
alexmeyer
alexmeyer2w ago
I'm supposed to be the one with weird, unexplained issues that nobody's ever seen before and can't replicate
Noel
NoelOP2w ago
yeah. either way, thanks for the help. These issues with flatpaks almost make me want to go back to normal Fedora, but then I'm like, no.
alexmeyer
alexmeyer2w ago
glad to help, even if it didn't go anywhere. sorry I don't have any other ideas
Noel
NoelOP2w ago
no worries. I'm not sure where I would even raise this issue to be honest.
alexmeyer
alexmeyer2w ago
right, I have no clue what is failing and where
Noel
NoelOP2w ago
I thought it was only the ansible plugin, but it's actually everything for me
alexmeyer
alexmeyer2w ago
yeah. and my issue in the past was always the other direction. suddenly apps can't open http links in my browser until I restart that flatpak-session-helper service. hasn't happened in a while I don't think, but it's a weird one
Noel
NoelOP2w ago
I've been liking Zed, it's just Red Hat wants me to use the Ansible plugin more to get more used to using it so I can inform customers how to use it. the problem is if I can't get it working, why bother? lol
alexmeyer
alexmeyer2w ago
right. I've seen some stuff about zed. looks cool, but every extension is made for vscode right now
Noel
NoelOP2w ago
Yeah
Faeiz Mahrus
Faeiz Mahrus2w ago
not needed in Firefox 121+ Firefox defaults to Wayland ootb flatpaks are half-baked inconsistent sandboxing across apps, integration issues

Did you find this page helpful?