Skip to content

fix(rclone): avoid freeze on encrypted config in remote generator#2626

Open
youcefzemmar wants to merge 1 commit into
withfig:masterfrom
youcefzemmar:fix/terminal-session-freezes-when-i-type-rclone-about
Open

fix(rclone): avoid freeze on encrypted config in remote generator#2626
youcefzemmar wants to merge 1 commit into
withfig:masterfrom
youcefzemmar:fix/terminal-session-freezes-when-i-type-rclone-about

Conversation

@youcefzemmar

Copy link
Copy Markdown

What

Pass --ask-password=false to rclone listremotes in the shared remote generator. When a user has an encrypted rclone config, the generator was running rclone listremotes synchronously and rclone blocked on an interactive password prompt — freezing the terminal session as soon as the user typed rclone about (or any other subcommand that takes a remote: arg).

Root cause

src/rclone.ts defined a single remote: Fig.Arg whose generator script was ["rclone", "listremotes"]. That arg (and its generators) is reused by cryptedremote, remotePath, sourcePath, and destPath, so every subcommand that accepts a remote inherits the same shell-out. With an encrypted config, rclone defaults to --ask-password=true and 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=false to the script array. --ask-password is a long-standing rclone global flag; with =false and no password available via RCLONE_CONFIG_PASS or --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 shared remote generator, so all four reusing args (cryptedremote, remotePath, sourcePath, destPath) pick it up with no duplication.

Testing

  • npx eslint src/rclone.ts — clean
  • npx prettier --check src/rclone.ts --parser typescript — clean
  • npx tsc --noEmit on the project — no new errors in src/rclone.ts (pre-existing at() lib errors in other specs are unrelated and present on master)
  • Manually verified rclone's behavior: with an encrypted config and no RCLONE_CONFIG_PASS, rclone listremotes --ask-password=false exits non-zero immediately instead of prompting; on an unencrypted config it behaves identically to the bare command.

Fixes #2102.

@withfig-bot

Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


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.
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@withfig-bot

Copy link
Copy Markdown
Contributor

Overview

src/rclone.ts:

Info:

@withfig-bot

Copy link
Copy Markdown
Contributor

Hello @youcefzemmar,
thank you very much for creating a Pull Request!
Here is a small checklist to get this PR merged as quickly as possible:

  • Do all subcommands / options which take arguments include the args property (args: {})?
  • Are all options modular? E.g. -a -u -x instead of -aux
  • Have all other checks passed?

Please add a 👍 as a reaction to this comment to show that you read this.

@youcefzemmar youcefzemmar marked this pull request as ready for review May 28, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Terminal session freezes when I type rclone about with fig on

2 participants