How to disable GtkFileChooserDialog search?

Solution 1:

The feature you are looking for is called "typeahead" and it is disabled in GtkFileChooserDialog. gtk3-typeahead from the AUR restores the previous behavior.

The package author says disabling typeahead is hardcoded in GTK+ and in a bug report it was stated: "It's not a bug; the removal of the type-ahead search was very much intentional."

Note there is now some (partially broken) tab-completion in the name/address field mimicking the behavior of the shell.

Solution 2:

Updated answer:

As of 2019, I have since hopped to using Arch's AUR repository (But still on my Debian system). I've also done this on FreeBSD, now, with small (somewhat trivial) patch. This is NOT a "switch to Arch" answer.

It was a bit hard to set up at first, but the gist of it is that you can in fact compile Arch's makepkg program and use it to compile AUR repositories on Debian. I did this like so (though I may have forgotten some dependencies):

My old answer is still present after the separator near the bottom.

1) Building makepkg:

sudo apt-get install bsdtar # pacman depends on bsdtar (libarchive) these days
git clone git://projects.archlinux.org/pacman.git
cd pacman
./configure --sysconfdir=/etc --localstatedir=/var --prefix=/opt/arch # Put built program outside of the usual '/usr/local' when installed to avoid conflicts
make
sudo make install # Install pacman/makepkg

# Make a directory pacman expects to exist to dodge makepkg errors
sudo mkdir -p /var/cache/pacman/pkg

2) Preparation to compile the GTK3 sources:

Now, to build and install gtk3-typeahead. To get all the (debian) build dependencies, which more or less are the same as the Arch ones, you must first have a deb-src line in your sources.list so that apt-get build-dep will successfully fetch the necessary -dev packages.

My sources.list contains the following line to do that. Change the line based on your release and nearest server.

deb-src http://ftp.us.debian.org/debian/ sid main contrib

3) Building gtk3-typeahead:

Then, you can run the following to build gtk3-typeahead:

sudo apt-get update
sudo apt-get build-dep 'gtk+3.0' # install gtk3 build dependencies

mkdir /path/to/put/arch/git/repo/into
cd /path/to/put/arch/git/repo/into
git clone https://aur.archlinux.org/gtk3-typeahead.git gtk3-typeahead
cd gtk3-typeahead

# Tack onto configure script arguments so that libraries overwrite the official
# Debian ones in /usr/lib/x86_64-linux-gnu, instead of installing to /usr/lib. 
# CHANGE THIS APPROPRIATELY IF RUNNING 32-BIT (or some other architecture like POWER/MIPS)
sed '/\-\-sysconfdir=/a\
        --libdir=/usr/lib/x86_64-linux-gnu \\' PKGBUILD > PKGBUILD2
mv PKGBUILD2 PKGBUILD

# temporarily add archlinux programs to PATH so we can use 'makepkg'
PATH="/opt/arch/bin:""$PATH"

# Don't check pacman dependencies, since our dependency libraries weren't
# installed via pacman like makepkg expects!
makepkg --nodeps

After doing this, the binaries will be packed up in a .tar.gz archive one level above the git tree. In my example, this would be the into directory.

To install it:

TARBALLPATH="$(readlink -f gtk3-typeahead-*.tar.gz | sort | tail -n 1)" # get full path to tarball of most recent build, if multiple are available
cd /
bsdtar xf "$TARBALLPATH"

This is highly scriptable, and a bit less finnicky than dealing with my old scripts in my humble opinion. It also no longer depends on debian.


Original answer:

It's been a year and this still annoys me, since the GTK3 folks decided to hardcode this behaviour in, with no way to revert it without recompiling.

However, typeahead was patched back in to gtk3 as distributed in Ubuntu.

Ubuntu also made the file chooser require a doubleclick to choose a file, instead of only requiring a single click if the file was already selected. If you are OK with patching the gtk3 source code, I have made a patch which works as of gtk+ 3.22.7 combining the ubuntu patches and updating them to a more current version of GTK.

Additionally, I made a script for my debian system which automatically downloads the source for the latest version in the package manager, patches it, and compiles it. Runs correctly on Debian Sid, and should work fine for other Debian distros, too.

Solution 3:

On Debian unstable, you can get the typeahead functionality by pressing ctrl-l when the window is open (l for lookahead), but only for file open dialogues, not file save dialogues. For file save dialogues, ctrl-l will only highlight the name of the file to be saved. To navigate in a more intelligent way, you can type ~, /,. in the correct combinations to get your home directory, current directory, or a directory path from root. Also hitting the back arrow key can deselect the name and keep the cursor in the box so you don't loose the current name (as would occur in a "Save As" operation).

It seems to be that the old behavior was much better :)