Skip to content

Commit 87ea565

Browse files
author
Bruno Sutic
committed
Invoke less pager command in a subshell
This is done so that unsetting environment variable via `LESS=` works in all shells. For example, unsetting variable in `fish` shell, the command to use is env LESS= less ... To avoid handling all the cases we're executing the whole command in plain `sh`.
1 parent a231b95 commit 87ea565

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
- do not colorize `tree` output because a pager application might not handle it
55
well
66
- do not suggest using `more` program in the readme
7+
- invoke `less` pager command in a subshell so that unsetting environment
8+
variable via `LESS=` works in any shell
79

810
### v0.7.0, Sep 05, 2014
911
- bugfix: invalid params for 'save_sidebar_width' script

scripts/variables.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ TREE_FOCUS_OPTION="@sidebar-tree-focus"
1212
TREE_COMMAND="tree"
1313
TREE_COMMAND_OPTION="@sidebar-tree-command"
1414

15-
TREE_PAGER="LESS= less --dumb --chop-long-lines --tilde --IGNORE-CASE --RAW-CONTROL-CHARS"
15+
TREE_PAGER='sh -c "LESS= less --dumb --chop-long-lines --tilde --IGNORE-CASE --RAW-CONTROL-CHARS"'
1616
TREE_PAGER_OPTION="@sidebar-tree-pager"
1717

1818
TREE_POSITION="left"

0 commit comments

Comments
 (0)