- [x] I have searched open and closed issues for duplicates.
----------------------------------------
## Environment info
<!-- Please include some relevant information about your environment. -->
<!-- For "Backend", please indicate the backup destination (e.g. Amazon S3, OneDrive, FTP, WebDAV, local). -->
- **Duplicati version**: 2.0.3.11
- **Operating system**: Debian 9
- **Backend**: ownCloud / webDAV
## Expected Behavior
When decrypting a duplicati backup, I can enter my private key passphrase into pinentry.
## Actual Behavior
Pinentry does not capture the input correctly, so I can't enter my password. Instead, the terminal crashes and produces gibberish. The mode of entering stars is sometimes on, sometimes off; when opening vim in the same shell afterwards, sometimes i is not parsed as "insert mode" anymore, instead a * is written to the top left of the screen (but not into the file). reset does not help, only closing the shell is helping.
I tested it both with the normal ssh shell and with tmux.
## Steps to reproduce
1. ssh into the server
2. ```export GPG_TTY=$(tty)```
3. ```duplicati-cli backup webdav://owncloud.test.org/remote.php/dav/files/staging/ duplicati_2.0.3.3-1_all.deb --auth-password=test --auth-username=test --use-ssl --encryption-module=gpg --gpg-encryption-command=--encrypt --gpg-encryption-switches=--recipient\ "test@test.org" --passphrase=unused --prefix=testgpg4 ```
4. ```duplicati-cli restore webdav://owncloud.test.org/remote.php/dav/files/staging/ --auth-password=test --auth-username=test --use-ssl --encryption-module=gpg --gpg-encryption-command=--decrypt --passphrase=unused --prefix=testgpg4```
5. Try to enter passphrase into prompt
6. At some point, give up and press ctrl+c
7. while some of the entered chars are randomly turned into *, open vim
8. press a for a while, press enter once, press a for a while again, when it says "--insert--" at the bottom, press enter again
9. see the pinentry shell again, which tells you that you have 2 tries left for the passphrase
10. enter the passphrase correctly
11. see how it goes back to the duplicati shell, but does nothing for at least 10 minutes (I'm keeping you updated if this changes.)
## Screenshots
before it loads the pinentry prompt:
![screenshot_2018-10-19_17-52-02](https://user-images.githubusercontent.com/19255313/47234947-bb622180-d3d7-11e8-9176-b44a6ab55a2b.png)
first pinentry does not capture the input:
![screenshot_2018-10-19_18-58-31](https://user-images.githubusercontent.com/19255313/47235564-b7370380-d3d9-11e8-9c42-a01d8cffb1b4.png)
at some point it captures random letters (but not all), until you finish the process with ctrl+c:
![screenshot_2018-10-19_18-59-00](https://user-images.githubusercontent.com/19255313/47235660-f9f8db80-d3d9-11e8-87d4-5249d276bb0c.png)
Even if you reset the terminal, it randomly changes some letters you enter into *, they even jump to the imaginary line in the center of the screen:
![screenshot_2018-10-19_18-59-00](https://user-images.githubusercontent.com/19255313/47235744-3e847700-d3da-11e8-8ee7-c98f1926f246.png)
And even inside vim:
![screenshot_2018-10-19_19-04-08](https://user-images.githubusercontent.com/19255313/47235765-4d6b2980-d3da-11e8-84b8-e58e4325e514.png)
But if you press the right keys, you suddenly glitch back into pinentry:
![screenshot_2018-10-19_20-06-32](https://user-images.githubusercontent.com/19255313/47236005-0c274980-d3db-11e8-9260-29718a88b389.png)
And if you enter the passphrase correctly, you see the duplicati shell again, but it's frozen:
![screenshot_2018-10-19_20-08-55](https://user-images.githubusercontent.com/19255313/47236036-282aeb00-d3db-11e8-83cf-58f289895e56.png)
What a ride.
## Related
issue in the duplicati issue tracker: https://github.com/duplicati/duplicati/issues/3446