Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot open multiple vscode instances #19

Closed
13hannes11 opened this issue Jan 26, 2022 · 4 comments
Closed

Cannot open multiple vscode instances #19

13hannes11 opened this issue Jan 26, 2022 · 4 comments

Comments

@13hannes11
Copy link

Once vscode is opened by code . I cannot open another instance of it:

toolbox-vscode: Creating /root/.vscode-server/data/Machine/settings.json
/var/home/someuser/.local/bin/code: line 382: /root/.vscode-server/data/Machine/settings.json: Permission denied
@dyskette
Copy link

dyskette commented Mar 1, 2022

I'm using Fedora Silverblue with Flatpak 1.12.5 and I don't get that error. But trying to open another instance using code . again from toolbox doesn't work. It does nothing and doesn't output anything bad even with verbose arguments passed.

$ code --toolbox-verbose --verbose .
toolbox-vscode: Checking if Visual Studio Code Flatpak is installed
toolbox-vscode: Visual Studio Code Flatpak is installed
toolbox-vscode: Checking for running Visual Studio Code Flatpak
toolbox-vscode: Found running Visual Studio Code Flatpak, will use 'flatpak enter'
+ flatpak-spawn --host flatpak enter 2806685128 sh -c '
        cd $0
        HOME=$1
        shift
        DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$UID/bus
        DBUS_SYSTEM_BUS_ADDRESS=unix:path=/run/dbus/system_bus_socket
        XDG_DATA_HOME="$HOME/.var/app/com.visualstudio.code/data"
        XDG_CONFIG_HOME="$HOME/.var/app/com.visualstudio.code/config"
        XDG_CACHE_HOME="$HOME/.var/app/com.visualstudio.code/cache"
        export HOME DBUS_SESSION_BUS_ADDRESS DBUS_SYSTEM_BUS_ADDRESS \
            XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME
        ELECTRON_RUN_AS_NODE=1 \
        PATH="${PATH}:$XDG_CONFIG_HOME/node_modules/bin" \
            exec "$@"
    ' /var/home/dyskette/Projects/storefront-themes /var/home/dyskette /app/extra/vscode/code /app/extra/vscode/resources/app/out/cli.js --extensions-dir=/var/home/dyskette/.var/app/com.visualstudio.code/data/vscode/extensions --remote attached-container+687870 --verbose /var/home/dyskette/Projects/storefront-themes

That's all the output. It just does nothing after that.

I removed the whole condition and left the flatpak run call only. That seemed to work for me.

@13hannes11
Copy link
Author

I don't use that workflow anymore so sadly cannot verify if that would work for me.

@owtaylor
Copy link
Owner

owtaylor commented Mar 7, 2022

Thanks for the report - turned out a small adjustment was needed in the code that opens another window in the existing process.

According to flathub/com.visualstudio.code#210 (comment) for Flatpak 1.11 and newer, we could simply remove all this complexity. After Fedora 34 EOL this spring (Flatpak 1.10), next time things break, I'll test and if it works, do go ahead and do that.

@dyskette
Copy link

dyskette commented Mar 8, 2022

Thanks. The change seems to works fine as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants