cursor icon indicating copy to clipboard operation
cursor copied to clipboard

Open File dialog in Ubuntu/Gnome: default directory and use of native control

Open manelio opened this issue 1 year ago • 0 comments

System: Ubuntu 24.04
Cursor Version: 0.40

The issues with the file open dialog in Ubuntu have been a headache in Electron-based apps like Cursor and VSCode. I'm not sure if this issue is related to Cursor, Electron, or whether it's caused by the use (or absence) of portals.

I have been working with Cursor 0.7.3 (VSCode 1.80.1) for a long time.

The file open dialog used to be the same as in other apps, a sort of "native dialog."

By default, the dialog opens in the current file's directory. Additionally, my small customizations to the GTK theme, which bring back the "navigate to parent directory with backspace" functionality, work (see Note 1).

In Version 0.40:

  • It's NOT the native system dialog (see Note 1). I cannot navigate to the parent directory using the backspace key (❌).
  • The default directory is "Recent Files". It doesn't open in the focused document's directory (❌).

The file selection dialog is a central component of the operating system. In an application like Cursor, where opening and saving files is a frequent task, issues with the file selection dialog severely affect the user experience.

Is there any way to force the usage of native file dialogs?


Note 1:

For some reason, Gnome decided to remove the use of the backspace key to navigate back in file dialogs. To work around this, I made a small modification:

cat ~/.themes/custom/gtk-3.0/gtk-keys.css
@binding-set MyOwnFilechooserBindings
{
    bind "BackSpace" { "up-folder" () };
}

filechooser
{
    -gtk-key-bindings: MyOwnFilechooserBindings;
}
gsettings set org.gnome.desktop.interface gtk-key-theme custom

manelio avatar Sep 11 '24 10:09 manelio