Tab-completion of remotes breaks if no config file

What is the problem you are having with rclone?

If no config file exists, e.g. on a fresh install, then tab-completion of remotes fails. Hitting tab causes:

  • a notice (config file not found) to be printed to the shell
  • the shell doesn't return to the command prompt - you have to hit tab a second time, or return, to get back to $

The expected behaviour of tab-completion when no completion candidates exist is silence.

Tab-completion of commands is fine.

I think the cause is this line in /usr/share/bash-completion/completions/rclone:

done < <(command rclone listremotes)

which should perhaps read

done < <(command rclone listremotes --quiet)

but this script appears to be autogenerated.

What is your rclone version (output from rclone version)

rclone v1.53.3-DEV

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Seen on both:

  • WSL2 on Windows 10 with bash version 5.1.4(1)-release
  • Raspberry Pi OS 32-bit bullseye with bash version 5.1.4(1)-release

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone sync [then hit TAB]

The rclone config contents with secrets removed.

None.

A log from the command with the -vv flag

pi@aleph:~ $ rclone sync -vv [hit TAB here]2021/12/03 13:11:10 NOTICE: Config file "/home/pi/.config/rclone/rclone.conf" not found - using defaults
[hit TAB again here to get back to prompt]2021/12/03 13:11:11 NOTICE: Config file "/home/pi/.config/rclone/rclone.conf" not found - using defaults

.bash_aliases     .bashrc           .gitconfig        .profile          .ssh/ 
.bash_history     .cache/           .gnupg/           .selected_editor  .config/
pi@aleph:~ $

You have a really old version and a dev version.

I can't produce the same thing on the current version.

root@gemini:~# rclone version
rclone v1.57.0
- os/version: ubuntu 20.04 (64 bit)
- os/kernel: 5.11.0-41-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.17.2
- go/linking: static
- go/tags: none
root@gemini:~# rclone sync -vv .
./             ../            .bash_history  .bashrc        .cache/        .config/       .local/        .npm/          .profile       .rnd           .ssh/          .step/         .viminfo       .wget-hsts
root@gemini:~# rclone sync -vv .
./             ../            .bash_history  .bashrc        .cache/        .config/       .local/        .npm/          .profile       .rnd           .ssh/          .step/         .viminfo       .wget-hsts
root@gemini:~# rclone sync -vv .

The version I'm using is just the latest from the Debian stable repository i.e. the default for Raspberry Pi OS and WSL. I don't know why it's a development version.

Ah great. I tried installing 1.57.0 manually and, as you say, completions were fine.

Hopefully Debian picks up a fixed version at some point.

That's going to lag always.

For rclone, it's always better to not use a repo unfortunately as they aren't maintained / updated in a timely fashion.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.