diff options
| author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-05-25 23:27:12 +0200 |
|---|---|---|
| committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-05-25 23:27:12 +0200 |
| commit | e6441cbbd7715ad914d437ebbf7df71286e6fd19 (patch) | |
| tree | 459bcaeb3c4c2676522c9a83b184d82e420d4707 /modules/by-name/lf | |
| parent | lf/prev/helpers/show_image: Also show exif information, when showing an image (diff) | |
| download | nixos-config-e6441cbbd7715ad914d437ebbf7df71286e6fd19.zip | |
lf/commands/base.sh: Correctly escape single quotes for lf commands
Diffstat (limited to 'modules/by-name/lf')
| -rwxr-xr-x | modules/by-name/lf/lf/commands/base.sh | 3 |
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 |
