about summary refs log tree commit diff stats
path: root/modules/by-name/lf
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-05-25 23:27:12 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-05-25 23:27:12 +0200
commite6441cbbd7715ad914d437ebbf7df71286e6fd19 (patch)
tree459bcaeb3c4c2676522c9a83b184d82e420d4707 /modules/by-name/lf
parentlf/prev/helpers/show_image: Also show exif information, when showing an image (diff)
downloadnixos-config-e6441cbbd7715ad914d437ebbf7df71286e6fd19.zip
lf/commands/base.sh: Correctly escape single quotes for lf commands
Diffstat (limited to 'modules/by-name/lf')
-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