i3-sensible-pager: sanitize LESS environment variable (#5111)
When an error is encountered such as "The configured command for this shortcut could not be run successfully", the "show errors" button on i3-nagbar doesn't work if $PAGER is less, and $LESS contains either the -E or -F flag (the window pops up, but immediately disappears). Strip these flags from the LESS environment variable before invoking $pager.
This commit is contained in:
parent
ebcd1d43ea
commit
b242bcebcf
@ -8,6 +8,11 @@
|
||||
# Distributions/packagers can enhance this script with a
|
||||
# distribution-specific mechanism to find the preferred pager.
|
||||
|
||||
# The less -E and -F options exit immediately for short files, strip if present.
|
||||
case "$LESS" in
|
||||
*[EF]*) LESS=`echo "$LESS" | tr -d EF`
|
||||
esac
|
||||
|
||||
# Hopefully one of these is installed (no flamewars about preference please!):
|
||||
# We don't use 'more' because it will exit if the file is too short.
|
||||
# Worst case scenario we'll open the file in your editor.
|
||||
|
Loading…
Reference in New Issue
Block a user