about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rwxr-xr-xmodules/by-name/lf/lf/commands/base.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/by-name/lf/lf/commands/base.sh b/modules/by-name/lf/lf/commands/base.sh
index 7003d76c..0c2f391a 100755
--- a/modules/by-name/lf/lf/commands/base.sh
+++ b/modules/by-name/lf/lf/commands/base.sh
@@ -50,7 +50,6 @@ trap 'rm --recursive "$__base_tmp_temporary_directory"' EXIT
 
 # Run a lf command on the current lf client
 # All arguments will run in like they were typed directly into lf.
-# # TODO(@bpeetz): Escape the single quotes in the input arguments. <2025-02-02>
 #
 # # Type
 # lf_cmd :: [String]
@@ -61,6 +60,8 @@ trap 'rm --recursive "$__base_tmp_temporary_directory"' EXIT
 lf_cmd() {
     arguments=""
     for arg in "$@"; do
+        arg="$(echo "$arg" | sed "s/'/\\\'/g")"
+
         if [ -z "$arguments" ]; then
             arguments="'$arg'"
         else