Rclone cannot read passwords on Cygwin / Git bash / mintty

When using rclone on Windows 8.1 from a Cygwin shell or the shell provided by Git in Windows, asking for a password fails. Here is an example interaction:

~/d/Downloads/rclone-v1.40-windows-amd64 % rclone config
2018/04/25 10:00:04 NOTICE: Config file "C:\\Users\\rpost\\.rclone.conf" not found - using defaults
No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q> s
Your configuration is not encrypted.
If you add a password, you will protect your login information to cloud services.
a) Add Password
q) Quit to main menu
a/q> a
Enter NEW configuration password:
2018/04/25 10:00:12 Failed to read password: The handle is invalid.

Once an encryption password is set, rclone will ask for it immediately, which also fails.The workaround is to set the RCLONE_CONFIG_PASS environment variable prior to invoking rclone.

This doesn’t occur when using cmd, the Windows command line interpreter.

A fix or better workaround will be appreciated.

PS: see also https://stackoverflow.com/questions/49588368/python-subprocess-how-to-send-a-password-rclone-configuration

Like in that case, the reason I ran into this is my need to perform rclone calls from a script.

Can you please make a new issue on github about this. It looks like something which needs a fix!

I wonder what is different about the Cygwin shell or the git shell?

I wrote a new answer for that question :slight_smile:

I’ve tested a Cygwin xterm, the “Cygwin64 Terminal” it provides, and the “Git Bash” provided by Git on Windows provides when you start its shell. The latter two are Mintty. I haven’t played with any options so it might be possible to fix it that way.