Skip to content

fix(cable): remove redundant quoting around {} in action commands#1048

Open
Mic92 wants to merge 1 commit intoalexpasmantier:mainfrom
Mic92:fix-cable-double-quoting
Open

fix(cable): remove redundant quoting around {} in action commands#1048
Mic92 wants to merge 1 commit intoalexpasmantier:mainfrom
Mic92:fix-cable-double-quoting

Conversation

@Mic92
Copy link
Copy Markdown

@Mic92 Mic92 commented Apr 19, 2026

Since format_command() already wraps each entry in single quotes when substituting a bare {} placeholder, having '{}' in the channel config results in ''entry'', which the shell parses as an unquoted string. This breaks any action on entries containing spaces, e.g. in the downloads, dirs, files and zoxide channels:

rm: cannot remove '/home/user/Downloads/Ethereum': No such file or directory
rm: cannot remove 'Flakes.pdf': No such file or directory

Preview commands are left untouched since they go through Template::format which does not auto-quote.

Fixes #976

Since format_command() already wraps each entry in single quotes when
substituting a bare {} placeholder, having '{}' in the channel config
results in ''entry'' which the shell parses as an unquoted string.
This breaks any action on entries containing spaces, e.g. in the
downloads, dirs, files and zoxide channels:

  rm: cannot remove '/home/user/Downloads/Ethereum': No such file or directory
  rm: cannot remove 'Flakes.pdf': No such file or directory

Preview commands are unaffected as they use a different code path
(Template::format) without auto-quoting, so those keep their explicit
quotes.

Fixes alexpasmantier#976
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.

Default dirs channel cd action breaks on paths with spaces (double-quoting)

1 participant