fix(rclone): avoid freeze on encrypted config in remote generator - #2626
fix(rclone): avoid freeze on encrypted config in remote generator#2626ogyamada wants to merge 1 commit into
Conversation
|
I have read the CLA Document and I hereby sign the CLA root seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. |
Overviewsrc/rclone.ts:Info: |
|
Hello @youcefzemmar,
Please add a 👍 as a reaction to this comment to show that you read this. |
What
Pass
--ask-password=falsetorclone listremotesin the sharedremotegenerator. When a user has an encrypted rclone config, the generator was runningrclone listremotessynchronously and rclone blocked on an interactive password prompt — freezing the terminal session as soon as the user typedrclone about(or any other subcommand that takes aremote:arg).Root cause
src/rclone.tsdefined a singleremote: Fig.Argwhose generator script was["rclone", "listremotes"]. That arg (and itsgenerators) is reused bycryptedremote,remotePath,sourcePath, anddestPath, so every subcommand that accepts a remote inherits the same shell-out. With an encrypted config, rclone defaults to--ask-password=trueand reads from the controlling tty, which the autocomplete generator has no way to feed — so the call hangs and the shell appears frozen until rclone is killed.Fix
One-token change: append
--ask-password=falseto thescriptarray.--ask-passwordis a long-standing rclone global flag; with=falseand no password available viaRCLONE_CONFIG_PASSor--password-command, rclone exits non-zero instead of prompting. The generator then yields an empty list rather than freezing — which is the desired UX when we genuinely can't enumerate remotes. The change stays scoped to the sharedremotegenerator, so all four reusing args (cryptedremote,remotePath,sourcePath,destPath) pick it up with no duplication.Testing
npx eslint src/rclone.ts— cleannpx prettier --check src/rclone.ts --parser typescript— cleannpx tsc --noEmiton the project — no new errors insrc/rclone.ts(pre-existingat()lib errors in other specs are unrelated and present onmaster)RCLONE_CONFIG_PASS,rclone listremotes --ask-password=falseexits non-zero immediately instead of prompting; on an unencrypted config it behaves identically to the bare command.Fixes #2102.