Search code examples
emacsdiredeshell

In Dired, how do I add the file path to the kill ring with relevant characters escaped?


As this answer explains, the Dired function dired-copy-filename-as-kill (0 w) lets one add the path of the file at point to the kill ring. However, I would like to use this path on Eshell, where characters such as SPC need to be escaped. Is there a way to copy the path to the kill ring with the relevant characters escaped, or to transform a previous kill so as to escape these characters?


Solution

  • You're probably looking for C-hf eshell-quote-argument.