1
0
mirror of https://github.com/rclone/rclone.git synced 2025-12-06 00:03:32 +00:00

config: fix problem reading pasted tokens over 4095 bytes

Before this change we were reading input from stdin using the terminal
in the default line mode which has a limit of 4095 characters.

The typical culprit was onedrive tokens (which are very long) giving the error

    Couldn't decode response: invalid character 'e' looking for beginning of value

This change swaps over to use the github.com/peterh/liner read line
library which does not have that limitation and also enables more
sensible cursor editing.

Fixes #8688 #8323 #5835
This commit is contained in:
Nick Craig-Wood
2025-08-13 15:26:48 +01:00
parent 8d878d0a5f
commit b0b3b04b3b
6 changed files with 32 additions and 23 deletions

1
go.mod
View File

@@ -56,6 +56,7 @@ require (
github.com/ncw/swift/v2 v2.0.4
github.com/oracle/oci-go-sdk/v65 v65.98.0
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/peterh/liner v1.2.2
github.com/pkg/sftp v1.13.9
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2
github.com/prometheus/client_golang v1.23.0