microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
158.93k stars 27.79k forks source link

Cannot open source files from within file manager (Thunar) #212125

Open majid4466 opened 1 week ago

majid4466 commented 1 week ago

Type: Bug

After the most recent update when I double click source files (.php, .js, etc.) a new instance of VS code is spawned and nothing is opened, neither in the already open vs code instance nor in the new one.

Files could be opened by dropping them on VS code window and by using the explorer as well as using search results.

My dev box has Xubuntu 20.04 and the file manager I use is Thunar. Here is the version information from the "About" dialog:

Version: 1.89.0 Commit: b58957e67ee1e712cebf466b995adf4c5307b2bd Date: 2024-05-01T02:08:25.066Z Electron: 28.2.8 ElectronBuildId: 27744544 Chromium: 120.0.6099.291 Node.js: 18.18.2 V8: 12.0.267.19-electron.0 OS: Linux x64 5.4.0-177-generic

VS Code version: Code 1.89.0 (b58957e67ee1e712cebf466b995adf4c5307b2bd, 2024-05-01T02:08:25.066Z) OS version: Linux x64 5.4.0-177-generic Modes:

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-8500Y CPU @ 1.50GHz (4 x 2949)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|2, 2, 2| |Memory (System)|7.65GB (3.81GB free)| |Process Argv|--unity-launch --crash-reporter-id e0cccab9-1704-45d5-9a6d-97943ca924da| |Screen Reader|no| |VM|0%| |DESKTOP_SESSION|xubuntu| |XDG_CURRENT_DESKTOP|XFCE| |XDG_SESSION_DESKTOP|xubuntu| |XDG_SESSION_TYPE|x11|
Extensions (10) Extension|Author (truncated)|Version ---|---|--- vscode-intelephense-client|bme|1.10.4 prettier-vscode|esb|10.4.0 copilot|Git|1.187.0 copilot-chat|Git|0.15.2024043005 todo-tree|Gru|0.0.226 remote-ssh|ms-|0.110.1 remote-ssh-edit|ms-|0.86.0 remote-explorer|ms-|0.4.3 material-icon-theme|PKi|5.1.0 php-debug|xde|1.34.0 (1 theme extensions excluded)
A/B Experiments ``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vstes516:30244333 vscod805:30301674 binariesv615:30325510 vsaa593cf:30376535 py29gd2263:31024239 c4g48928:30535728 azure-dev_surveyone:30548225 2i9eh265:30646982 962ge761:30959799 pythongtdpath:30769146 welcomedialogc:30910334 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2:30936856 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 2e7ec940:31000449 pythontbext0:30879054 accentitlementst:30995554 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 ccp2r3:30993541 dsvsc020:30976470 pythonait:31006305 chatpanelc:31018788 dsvsc021:30996838 jg8ic977:31013176 pythoncenvpt:31022790 dwnewjupytercf:31035177 ```
bpasero commented 1 week ago

This does not sound like a bug in VS Code but an issue with your setup, but leaving this issue open to see if others hit it as well.

majid4466 commented 1 week ago

What inclined me to think this could be a VS Code bug is that it appeared exactly after the last VS Code update. VS Code is my IDE and I use it every day.

If there's something I can do to test which one is the case, I am more than willing to try.

I could think of one test, which is not conclusive but seems to suggest the issue is related to VS Code: I changed the Open With association of .js files from Visual Studio Code to Sublime Text. Double clicking .js files opened them in Sublime Text without an issue. I then changed the association back to VS Code and the issue was back. I repeated that with Mousepad with the same results (working with Mousepad and failing with VS Code.)

bpasero commented 1 week ago

So you cannot reproduce when you install 1.88.1?

VS Code Build: e170252f762678dec6ca2cc69aba1570769a5d39

cli-alpine-arm64: https://vscode.download.prss.microsoft.com/dbazure/download/stable/e170252f762678dec6ca2cc69aba1570769a5d39/vscode_cli_alpine_arm64_cli.tar.gz
cli-alpine-x64: https://vscode.download.prss.microsoft.com/dbazure/download/stable/e170252f762678dec6ca2cc69aba1570769a5d39/vscode_cli_alpine_x64_cli.tar.gz
cli-darwin-arm64: https://vscode.download.prss.microsoft.com/dbazure/download/stable/e170252f762678dec6ca2cc69aba1570769a5d39/vscode_cli_darwin_arm64_cli.zip
cli-darwin-x64: https://vscode.download.prss.microsoft.com/dbazure/download/stable/e170252f762678dec6ca2cc69aba1570769a5d39/vscode_cli_darwin_x64_cli.zip
cli-linux-arm64: https://vscode.download.prss.microsoft.com/dbazure/download/stable/e170252f762678dec6ca2cc69aba1570769a5d39/vscode_cli_linux_arm64_cli.tar.gz
cli-linux-armhf: https://vscode.download.prss.microsoft.com/dbazure/download/stable/e170252f762678dec6ca2cc69aba1570769a5d39/vscode_cli_linux_armhf_cli.tar.gz
cli-linux-x64: https://vscode.download.prss.microsoft.com/dbazure/download/stable/e170252f762678dec6ca2cc69aba1570769a5d39/vscode_cli_linux_x64_cli.tar.gz
cli-win32-arm64: https://vscode.download.prss.microsoft.com/dbazure/download/stable/e170252f762678dec6ca2cc69aba1570769a5d39/vscode_cli_win32_arm64_cli.zip
cli-win32-x64: https://vscode.download.prss.microsoft.com/dbazure/download/stable/e170252f762678dec6ca2cc69aba1570769a5d39/vscode_cli_win32_x64_cli.zip
darwin: https://vscode.download.prss.microsoft.com/dbazure/download/stable/e170252f762678dec6ca2cc69aba1570769a5d39/VSCode-darwin.zip
darwin-arm64: https://vscode.download.prss.microsoft.com/dbazure/download/stable/e170252f762678dec6ca2cc69aba1570769a5d39/VSCode-darwin-arm64.zip
darwin-universal: https://vscode.download.prss.microsoft.com/dbazure/download/stable/e170252f762678dec6ca2cc69aba1570769a5d39/VSCode-darwin-universal.zip
linux-arm64: https://vscode.download.prss.microsoft.com/dbazure/download/stable/e170252f762678dec6ca2cc69aba1570769a5d39/code-stable-arm64-1712770481.tar.gz
linux-armhf: https://vscode.download.prss.microsoft.com/dbazure/download/stable/e170252f762678dec6ca2cc69aba1570769a5d39/code-stable-armhf-1712770492.tar.gz
linux-deb-arm64: https://vscode.download.prss.microsoft.com/dbazure/download/stable/e170252f762678dec6ca2cc69aba1570769a5d39/code_1.88.1-1712770538_arm64.deb
linux-deb-armhf: https://vscode.download.prss.microsoft.com/dbazure/download/stable/e170252f762678dec6ca2cc69aba1570769a5d39/code_1.88.1-1712770545_armhf.deb
linux-deb-x64: https://vscode.download.prss.microsoft.com/dbazure/download/stable/e170252f762678dec6ca2cc69aba1570769a5d39/code_1.88.1-1712771838_amd64.deb
linux-rpm-arm64: https://vscode.download.prss.microsoft.com/dbazure/download/stable/e170252f762678dec6ca2cc69aba1570769a5d39/code-1.88.1-1712770627.el8.aarch64.rpm
linux-rpm-armhf: https://vscode.download.prss.microsoft.com/dbazure/download/stable/e170252f762678dec6ca2cc69aba1570769a5d39/code-1.88.1-1712770623.el8.armv7hl.rpm
linux-rpm-x64: https://vscode.download.prss.microsoft.com/dbazure/download/stable/e170252f762678dec6ca2cc69aba1570769a5d39/code-1.88.1-1712771932.el8.x86_64.rpm
linux-snap-x64: https://vscode.download.prss.microsoft.com/dbazure/download/stable/e170252f762678dec6ca2cc69aba1570769a5d39/code-stable-x64-1712773445.snap
linux-x64: https://vscode.download.prss.microsoft.com/dbazure/download/stable/e170252f762678dec6ca2cc69aba1570769a5d39/code-stable-x64-1712770462.tar.gz
win32-arm64: https://vscode.download.prss.microsoft.com/dbazure/download/stable/e170252f762678dec6ca2cc69aba1570769a5d39/VSCodeSetup-arm64-1.88.1.exe
win32-arm64-archive: https://vscode.download.prss.microsoft.com/dbazure/download/stable/e170252f762678dec6ca2cc69aba1570769a5d39/VSCode-win32-arm64-1.88.1.zip
win32-arm64-user: https://vscode.download.prss.microsoft.com/dbazure/download/stable/e170252f762678dec6ca2cc69aba1570769a5d39/VSCodeUserSetup-arm64-1.88.1.exe
win32-x64: https://vscode.download.prss.microsoft.com/dbazure/download/stable/e170252f762678dec6ca2cc69aba1570769a5d39/VSCodeSetup-x64-1.88.1.exe
win32-x64-archive: https://vscode.download.prss.microsoft.com/dbazure/download/stable/e170252f762678dec6ca2cc69aba1570769a5d39/VSCode-win32-x64-1.88.1.zip
win32-x64-user: https://vscode.download.prss.microsoft.com/dbazure/download/stable/e170252f762678dec6ca2cc69aba1570769a5d39/VSCodeUserSetup-x64-1.88.1.exe
ferby88 commented 1 week ago

I'm also experiencing the same issue with the Dolphin file manager after the last update, opening a file with the "Open file" dialog o dragging it to an opened Code window works fine.

Code is installed through the snap package manager.

These are the information displayed in the About dialog:

Version: 1.89.0 Commit: b58957e67ee1e712cebf466b995adf4c5307b2bd Date: 2024-05-01T02:08:25.066Z Electron: 28.2.8 ElectronBuildId: 27744544 Chromium: 120.0.6099.291 Node.js: 18.18.2 V8: 12.0.267.19-electron.0 OS: Linux x64 6.5.0-28-generic snap

bpasero commented 1 week ago

Please downgrade and see if its not reproducible then: https://github.com/microsoft/vscode/issues/212125#issuecomment-2097789123

ferby88 commented 1 week ago

I can confirm that reverting Code with the "snap revert" command resolved the issue, the current installation details are the following:

Version: 1.88.1 Commit: e170252f762678dec6ca2cc69aba1570769a5d39 Date: 2024-04-10T17:34:12.840Z Electron: 28.2.8 ElectronBuildId: 27744544 Chromium: 120.0.6099.291 Node.js: 18.18.2 V8: 12.0.267.19-electron.0 OS: Linux x64 6.5.0-28-generic snap

bpasero commented 1 week ago

Interesting, can you add a --verbose to the command line invocation or configure VS Code runtime arguments and add:

"log-level": "trace"
image

And then attach the logs folder with a clean startup via your finder. Maybe also comparing 1.89 to 1.90.

bpasero commented 1 week ago

@majid4466 are you also on Snap?

Does this reproduce when not using Snap but Deb?

majid4466 commented 1 week ago

Yes, I have VS Code installed as a Snap package.

I am hesitant to experiment with my development machine by uninstalling VS Code and testing the deb version. If I get the chance to install the deb version on another machine I will report the result here.

bpasero commented 1 week ago

Thanks

bpasero commented 1 week ago

But it would still be interesting to get at the verbose logs when it works vs when it does not work.

ferby88 commented 1 week ago

I tried to reproduce the issue on another workstation and a virtual machine but the snap package 1.89.0 works fine. It seems to be an issue with the snap refresh process and not with the version itself.

If I find some time today I will retry to upgrade Code again on the pc that presented the issue and let you know the result.

bpasero commented 1 week ago

Yeah I am not expecting a regression in VS Code but a setup/install issue.

ferby88 commented 1 week ago

I attached the log generated by opening a file from file manager with both Code versions. version-1.88.1-logs.zip version-1.89.0-logs.zip

bpasero commented 1 week ago

Yeah, as expected, in version 1.89 the instance receives the following argument for opening:

args: {"_":["/home/fabio/Downloads/New Folder/test.txt"]

And in 1.90:

args: {"_":[]

So on the way of opening from the finder to VS Code, the argument is either never passed or lost.

bpasero commented 1 week ago

Moving to Daniel and Deepak as this seems Snap install related, I doubt we changed something how we create the Snap file, but I am not sure either.

yukina3230 commented 1 week ago

I have the same issue on Gnome Nautilus, double click on the file in the file manager launches a new empty instance of VSCode. I'm using Arch and VSCode is installed through AUR.

Version: 1.89.1 Commit: dc96b837cf6bb4af9cd736aa3af08cf8279f7685 Date: 2024-05-07T05:16:23.416Z Electron: 28.2.8 ElectronBuildId: 27744544 Chromium: 120.0.6099.291 Node.js: 18.18.2 V8: 12.0.267.19-electron.0 OS: Linux x64 6.8.9-arch1-2

Sherevv commented 3 days ago

have the same issue on Gnome Nautilus, double click on the file in the file manager launches a new empty instance of VSCode. I'm using Arch and VSCode is installed through AUR.

same for me