Package: sensible-utils Version: 0.0.12+nmu1 Severity: normal Tags: patch It is generally possible in EDITOR and VISUAL to place arbitrary shell. For example, one can write something like the following:
export VISUAL='f(){ if [ -n "$DISPLAY" ]; then gvim -f "$@"; else vim "$@";
fi; };f'
This is supported by every program I can find which uses EDITOR and
VISUAL, including less, crontab, mutt, and git. It is my understanding
that supporting this is intentional, because otherwise it is impossible
to place quoted arguments inside a shell value, like so:
export VISUAL='vim +"setf perl"'
However, sensible-editor does not support that. It does perform shell
word splitting, but shell word splitting is not sufficient to handle the
cases mentioned above.
I've submitted a merge request at
https://salsa.debian.org/debian/sensible-utils/-/merge_requests/4 to
implement this behavior, add a test, and improve the existing test to be
more robust.
-- System Information:
Debian Release: bullseye/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1,
'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 5.6.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8),
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
-- no debconf information
--
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
signature.asc
Description: PGP signature

