Rclone authorize in WSL string gets cropped

What is the problem you are having with rclone?

I am using rclone on WSL (Windows Subsystem for Linux on Windows 11 running Ubuntu 22.04) for creating the authorization string needed by rclone on a single board computer without screen.
The problem is that the authorization string gets cropped in the WSL terminal, what does not fit in a line is not shown, so that I cannot copy and paste it wholly.

Run the command 'rclone version' and share the full output of the command.

In the headless machine (Debian 11 bullseye, currently the oldstable):
rclone v1.53.3-DEV

  • os/arch: linux/arm64
  • go version: go1.15.9

In the WSL one (Ubuntu 22.04 inside Windows 11):
rclone v1.53.3-DEV

  • os/arch: linux/amd64
  • go version: go1.18.1

Which cloud storage system are you using? (eg Google Drive)

Microsoft Sharepoint

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

rclone authorize "onedrive"

The rclone config contents with secrets removed.

[vitsolcpedia]
type = onedrive
token = {"access_token":"secretsecrets3cr3t","expiry":"2024-05-15T14:51:36.25766811+02:00"}
drive_id = b!ULA3U2AaK06F79enKkVJaJi3qM40pAJJiLxL_T-ffQJJuprpRoXBQbsDVuhImtuF
drive_type = documentLibrary

A log from the command with the -vv flag

rclone authorize "onedrive" -vv
2024/05/15 13:55:56 DEBUG : rclone: Version "v1.53.3-DEV" starting with parameters ["rclone" "authorize" "onedrive" "-vv"]
2024/05/15 13:55:56 DEBUG : Using config file from "/home/user/.config/rclone/rclone.conf"
2024/05/15 13:55:56 DEBUG : Starting auth server on 127.0.0.1:53682
If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=IHfLtyK6sGYfzHIkjCNglA
Log in and authorize rclone for access
Waiting for code...
2024/05/15 13:56:08 DEBUG : Received GET request on auth server to "/"
Got code
Paste the following into your remote machine --->
{"access_token":"eyJ0eXAiOiJKV1QiLCJub25jZSI6ImpoOGxFZ0Y0NVUwdmJqQWU4Yjh6VnlSdHpqS0puWG9hdVZ5SWpaY05DVE0iLCJhbGciOiJSUzI1NiIsIng1dCI6IkwxS2ZLRklfam5YYndXYzIyeFp4dzFzVUhIM}
<---End paste
2024/05/15 13:56:08 DEBUG : **temp-fs**: Saved new token in config file
2024/05/15 13:56:08 DEBUG : Closing auth server
2024/05/15 13:56:08 DEBUG : Closed auth server with error: accept tcp 127.0.0.1:53682: use of closed network connection
2024/05/15 13:56:08 DEBUG : rclone: Version "v1.53.3-DEV" finishing with parameters ["rclone" "authorize" "onedrive" "-vv"]

The workaround that I found is launching this command on WSL before requiring the authentication string:

stty columns 3000

You'd want to update rclone as that's a mega ancient version.

Tried to compile it on WSL, got this error:

make
go build -v --ldflags "-s -X github.com/rclone/rclone/fs.Version=v1.67.0-beta.7959.6a0a54ab9"
github.com/rclone/rclone/lib/debug
# github.com/rclone/rclone/lib/debug
lib/debug/common.go:17:15: undefined: debug.SetMemoryLimit
note: module requires Go 1.20
github.com/rclone/rclone/fs
go.opentelemetry.io/otel/internal/global
# go.opentelemetry.io/otel/internal/global
../go/pkg/mod/go.opentelemetry.io/otel@v1.21.0/internal/global/handler.go:44:18: undefined: atomic.Pointer
../go/pkg/mod/go.opentelemetry.io/otel@v1.21.0/internal/global/internal_logging.go:30:25: undefined: atomic.Pointer
note: module requires Go 1.20
google.golang.org/grpc
storj.io/uplink/private/eestream/improved
# github.com/rclone/rclone/fs
fs/versioncheck.go:7:15: undefined: Go_version_1_20_required_for_compilation
note: module requires Go 1.20
# storj.io/uplink/private/eestream/improved
../go/pkg/mod/storj.io/uplink@v1.12.2/private/eestream/improved/bufpool.go:49:18: undefined: atomic.Int32
../go/pkg/mod/storj.io/uplink@v1.12.2/private/eestream/improved/bundy.go:32:30: undefined: atomic.Int32
../go/pkg/mod/storj.io/uplink@v1.12.2/private/eestream/improved/bundy.go:33:30: undefined: atomic.Int32
../go/pkg/mod/storj.io/uplink@v1.12.2/private/eestream/improved/bundy.go:34:30: undefined: atomic.Int32
../go/pkg/mod/storj.io/uplink@v1.12.2/private/eestream/improved/bundy.go:35:31: undefined: atomic.Int32
../go/pkg/mod/storj.io/uplink@v1.12.2/private/eestream/improved/bundy.go:46:26: undefined: atomic.Int32
../go/pkg/mod/storj.io/uplink@v1.12.2/private/eestream/improved/piece.go:29:31: undefined: atomic.Pointer
../go/pkg/mod/storj.io/uplink@v1.12.2/private/eestream/improved/piece.go:32:29: undefined: atomic.Int64
../go/pkg/mod/storj.io/uplink@v1.12.2/private/eestream/improved/piece.go:35:29: undefined: atomic.Int32
../go/pkg/mod/storj.io/uplink@v1.12.2/private/eestream/improved/improved.go:59:25: undefined: atomic.Int32
../go/pkg/mod/storj.io/uplink@v1.12.2/private/eestream/improved/bundy.go:46:26: too many errors
note: module requires Go 1.19
# google.golang.org/grpc
../go/pkg/mod/google.golang.org/grpc@v1.60.1/server.go:2165:14: undefined: atomic.Int64
note: module requires Go 1.19
make: *** [Makefile:54: rclone] Error 2
go build
# github.com/rclone/rclone/lib/debug
lib/debug/common.go:17:15: undefined: debug.SetMemoryLimit
note: module requires Go 1.20
# go.opentelemetry.io/otel/internal/global
../go/pkg/mod/go.opentelemetry.io/otel@v1.21.0/internal/global/handler.go:44:18: undefined: atomic.Pointer
../go/pkg/mod/go.opentelemetry.io/otel@v1.21.0/internal/global/internal_logging.go:30:25: undefined: atomic.Pointer
note: module requires Go 1.20
# github.com/rclone/rclone/fs
fs/versioncheck.go:7:15: undefined: Go_version_1_20_required_for_compilation
note: module requires Go 1.20
# storj.io/uplink/private/eestream/improved
../go/pkg/mod/storj.io/uplink@v1.12.2/private/eestream/improved/bufpool.go:49:18: undefined: atomic.Int32
../go/pkg/mod/storj.io/uplink@v1.12.2/private/eestream/improved/bundy.go:32:30: undefined: atomic.Int32
../go/pkg/mod/storj.io/uplink@v1.12.2/private/eestream/improved/bundy.go:33:30: undefined: atomic.Int32
../go/pkg/mod/storj.io/uplink@v1.12.2/private/eestream/improved/bundy.go:34:30: undefined: atomic.Int32
../go/pkg/mod/storj.io/uplink@v1.12.2/private/eestream/improved/bundy.go:35:31: undefined: atomic.Int32
../go/pkg/mod/storj.io/uplink@v1.12.2/private/eestream/improved/bundy.go:46:26: undefined: atomic.Int32
../go/pkg/mod/storj.io/uplink@v1.12.2/private/eestream/improved/piece.go:29:31: undefined: atomic.Pointer
../go/pkg/mod/storj.io/uplink@v1.12.2/private/eestream/improved/piece.go:32:29: undefined: atomic.Int64
../go/pkg/mod/storj.io/uplink@v1.12.2/private/eestream/improved/piece.go:35:29: undefined: atomic.Int32
../go/pkg/mod/storj.io/uplink@v1.12.2/private/eestream/improved/improved.go:59:25: undefined: atomic.Int32
../go/pkg/mod/storj.io/uplink@v1.12.2/private/eestream/improved/bundy.go:46:26: too many errors
note: module requires Go 1.19
# google.golang.org/grpc
../go/pkg/mod/google.golang.org/grpc@v1.60.1/server.go:2165:14: undefined: atomic.Int64
note: module requires Go 1.19

Even if I installed all the recent golang versions available in the Ubuntu 22.04 repositories:

apt list --installed | grep golang

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

golang-1.18-doc/jammy-updates,jammy-security,now 1.18.1-1ubuntu1.1 all [installed,automatic]
golang-1.18-go/jammy-updates,jammy-security,now 1.18.1-1ubuntu1.1 amd64 [installed,automatic]
golang-1.18-src/jammy-updates,jammy-security,now 1.18.1-1ubuntu1.1 all [installed,automatic]
golang-1.18/jammy-updates,jammy-security,now 1.18.1-1ubuntu1.1 all [installed,automatic]
golang-1.20-doc/jammy-updates,jammy-security,now 1.20.3-1ubuntu0.1~22.04.1 all [installed,automatic]
golang-1.20-go/jammy-updates,jammy-security,now 1.20.3-1ubuntu0.1~22.04.1 amd64 [installed,automatic]
golang-1.20-src/jammy-updates,jammy-security,now 1.20.3-1ubuntu0.1~22.04.1 all [installed,automatic]
golang-1.20/jammy-updates,jammy-security,now 1.20.3-1ubuntu0.1~22.04.1 all [installed]
golang-1.21-doc/jammy-updates,jammy-security,now 1.21.1-1~ubuntu22.04.2 all [installed,automatic]
golang-1.21-go/jammy-updates,jammy-security,now 1.21.1-1~ubuntu22.04.2 amd64 [installed,automatic]
golang-1.21-src/jammy-updates,jammy-security,now 1.21.1-1~ubuntu22.04.2 all [installed,automatic]
golang-1.21/jammy-updates,jammy-security,now 1.21.1-1~ubuntu22.04.2 all [installed]
golang-doc/jammy,now 2:1.18~0ubuntu2 all [installed,automatic]
golang-go/jammy,now 2:1.18~0ubuntu2 amd64 [installed,automatic]
golang-src/jammy,now 2:1.18~0ubuntu2 all [installed,automatic]
golang/jammy,now 2:1.18~0ubuntu2 amd64 [installed]

Just run the install or grab the latest binary. Bit easier than compiling:

Install (rclone.org)

I closed the WSL and re-opened it and the issue is not there anymore.
Sorry, I checked many times but I did not close the thing and open it again before.
So now it works, and I have no idea what I did earlier that caused this issue.
Please consider this issue closed.
Apologizes.