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

Linux file dialog does not use default file path #213780

Closed
aeschli opened this issue May 29, 2024 · 14 comments · Fixed by #222756, #225106 or #229329
Closed

Linux file dialog does not use default file path #213780

aeschli opened this issue May 29, 2024 · 14 comments · Fixed by #222756, #225106 or #229329
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug electron Issues and items related to Electron insiders-released Patch has been released in VS Code Insiders linux Issues with VS Code on Linux native-file-dialog Issues with native file dialog upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-fixed The underlying upstream issue has been fixed verified Verification succeeded

Comments

@aeschli
Copy link
Contributor

aeschli commented May 29, 2024

Testing #213763

Version: 1.90.0-insider
Commit: fc8762e
Date: 2024-05-29T05:51:07.154Z
Electron: 29.4.0
ElectronBuildId: 9593362
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Linux x64 5.15.0-107-generic

  • open a file in an editor
  • run File > Open FIle. This opens a file selection dialog initialized to the home folder

It should open on the folder of the currently active editor

@aeschli
Copy link
Contributor Author

aeschli commented May 29, 2024

Same problem with open folder dialog

@manelio
Copy link

manelio commented Jun 6, 2024

VS Code is awesome, but the open file dialog on Linux has been ridiculously buggy for years.

More than two years to fix the problem of the dialog opening in the background.

The fix, in the latest version, involves using a dialog inside a portal with no type-ahead support that opens in $HOME or recent files.

The open/save file dialog is a crucial control in any application. There should be a way to use the native OS dialog.

I'm going to downgrade to the previous version (1.89.1) and keep it as long as it takes.

@bpasero
Copy link
Member

bpasero commented Jun 6, 2024

cc @codebytere

@bpasero bpasero added linux Issues with VS Code on Linux native-file-dialog Issues with native file dialog labels Jun 6, 2024
@deepak1556
Copy link
Collaborator

We hadn't patched the portal code to support most of the file dialogs options, it is being addressed via electron/electron#42308.

@deepak1556
Copy link
Collaborator

This is now addressed in the runtime via electron/electron#42655, fix will be available once we adopt #215406

@deepak1556 deepak1556 added upstream-issue-fixed The underlying upstream issue has been fixed and removed upstream-issue-linked This is an upstream issue that has been reported upstream labels Jul 5, 2024
@vscodenpa vscodenpa added the unreleased Patch has not yet been released in VS Code Insiders label Jul 22, 2024
@deepak1556
Copy link
Collaborator

Reopening since we have reverted the updated due to other regressions #223494, will be revisited in August.

@RES-1
Copy link

RES-1 commented Aug 11, 2024

@bpasero bpasero reopened this Aug 12, 2024
@bpasero
Copy link
Member

bpasero commented Aug 12, 2024

This issue is not resolved for me, here is for comparison how the file dialog opens in an older version of VS Code vs. now:

Good behaviour:

Image

Bad behaviour:

Image

@bpasero
Copy link
Member

bpasero commented Aug 13, 2024

Filed electron/electron#43310

@deepak1556 deepak1556 added upstream-issue-linked This is an upstream issue that has been reported upstream and removed upstream-issue-fixed The underlying upstream issue has been fixed labels Aug 13, 2024
@riccardomanfrin
Copy link

I'm on xfce on xubuntu 22.04.
Version 1.89.1-1715060508_amd64 does not have the issue.
Later versions do have it.

The problem is that instead of forcing the "Open File" path, to that of the current file being edited, vscode delegates the path selection to the operating system, which resolves the "Recent Files" path.

Since recent files is truly not useful in vscode, I can at least pilot the path to be that of the home folder with

$> gsettings set org.gtk.Settings.FileChooser startup-mode 'cwd'

from the previous recent value. Clearly this is very inconvenient. Is there any update about it?

@drankinatty
Copy link

The issue is not resolved for me either. The file-open and directory-open dialogs still do not appear even though built on Electron 30.1.2. This is reproducible 100% of the time in openSUSE Tumbleweed and in Leap.

@deepak1556 deepak1556 added upstream-issue-fixed The underlying upstream issue has been fixed and removed upstream-issue-linked This is an upstream issue that has been reported upstream labels Sep 11, 2024
@drankinatty
Copy link

The file-open/directory-open or save dialog not being shown remains unresolved on Linux in release 1.93.1 built with electron 30.4.0.

@vs-code-engineering vs-code-engineering bot added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Sep 23, 2024
@bpasero bpasero added the verified Verification succeeded label Sep 26, 2024
@drankinatty
Copy link

The file-open/directory-open or file-save dialog not being shown remains unresolved on Linux in release 1.94,

Triggering a file-open/directory-open/file-save dialog is fundamental to do anything useful with an application. I can see one release having one hiccup and there being a temporary issue, but this vital function for Linux users seems to have been broken for an extended period of time. Nothing on my setup has changed, it's a simple x-windows setup that supports native x-windows dialogs, Qt dialogs (KDE) and Gtk dialogs (Gimp Toolkit, now more Gnome toolkit). There are also wx-widgets dialogs available.

The last release to provide a working file-open/save dialog on Linux is:

Version: 1.89.1
Release: 24130
Commit: a045dcfceda27f896936bfd8cbf524f6a93a2f46
Date: 2024-05-09T18:30:40.866Z
Electron: 28.2.8
ElectronBuildId: undefined
Chromium: 120.0.6099.291
Node.js: 18.18.2
V8: 12.0.267.19-electron.0
OS: Linux x64 6.11.2-1-default

Judging from the dialog opened in 1.89 it seems to be triggering the Gtk file-open dialog, the same triggered by file-open in firefox, e.g.

Image

This needs to be fixed. There are many improvements between ver. 1.89 and 1.94 that are simply not available to Linux users (unless they go to extreme measures to manage open files from the command-line, unrealistic)

I'm happy to test if you come up with a scenario that needs testing. I'm currently running openSUSE Tumbleweed, so all packages are standard and are current versions.

@deepak1556
Copy link
Collaborator

@drankinatty can you start v1.94 with code --verbose --vmodule=*/ui/*=2, trigger the open file dialog action and attach the output here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug electron Issues and items related to Electron insiders-released Patch has been released in VS Code Insiders linux Issues with VS Code on Linux native-file-dialog Issues with native file dialog upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-fixed The underlying upstream issue has been fixed verified Verification succeeded
Projects
None yet
8 participants