vscode: Cannot open source files from within file manager (Thunar)
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® Core™ 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
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 32 (14 by maintainers)
Based on the affected versions, seems like a regression from https://github.com/microsoft/vscode/commit/0da22a226000adc62cf7b8a83b045668fb8a9296
@rzhao271 I updated code the last time to version 1.93.1 on 2024-09-13 via apt. The current .desktop file(s) looks like this:
No
--unity-launchflag and the executable points to/usr/share/code/codewhich is a binary file.When running code from the terminal,
whichgives:This is a symlink and the executable points to
/usr/share/code/bin/codewhich is a shell script.Running
/usr/share/code/code SOMEFILE.txtor/usr/share/code/bin/code SOMEFILE.txtfrom the terminal opens the file in a new tab as expected.Double clicking the file opens an empty code window and the process output shows:
The
--unity-launchflag is present there.As @majid4466 mentioned, the Whisker Menu entry still contains the flag. I boiled it down to be located here:
The
~/.local/share/applicationsfolder “overwrites” the/usr/share/applicationsfolder.Removing the
--unity-launchflag in~/.local/share/applications/code.desktopsolves the problem.Based on the latest posts here and pointing to a regression from 0da22a2 I found a workaround. I am on an Xubuntu machine with XFCE and Whiskers menu. Here is what I did:
/usr/share/code/code --unity-launch %F--unity-launchflag and saved.That was it! The issue gone.
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
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