From 9544316ef95c2aa1e75101a7dce545b4604b3ca6 Mon Sep 17 00:00:00 2001 From: Lars Schneider Date: Tue, 24 Jul 2018 22:55:48 +0200 Subject: add -F and -X to default $LESS environment variable (#6611) The option '-F' causes 'less' to automatically quit if the contents fit the screen and the option '-X' causes 'less' to not clear the screen after quit. I think both options are generally useful for terminal applications. They are in particular useful for Git as it runs all output through a pager. Git will run 'less' with '-FRX' by default if the environment variable $LESS is not defined [1]. Since oh-my-zsh used to set $LESS to '-R', Git would not override this setting. Consequently, Git would display even a single line of output in a pager and the user would need to explicitly quit that pager (see mailing list discussion [2]). Therefore, lets change the oh-my-zsh default value for $LESS to '-FRX'. This would be useful for oh-my-zsh Git users and likely for users of other applications that use 'less' too. [1] https://github.com/git/git/blob/36438dc19dd2a305dddebd44bf7a65f1a220075b/Documentation/config.txt#L819-L821 [2] https://public-inbox.org/git/2412A603-4382-4AF5-97D0-D16D5FAAFE28@eluvio.com/ --- lib/misc.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/misc.zsh') diff --git a/lib/misc.zsh b/lib/misc.zsh index 3052b7710..90a8d62f3 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -20,7 +20,7 @@ setopt long_list_jobs ## pager env_default PAGER 'less' -env_default LESS '-R' +env_default LESS '-FRX' ## super user alias alias _='sudo' -- cgit v1.2.3-70-g09d2 From 106f826075979ef1a6875cedd2d098e601f2e3f2 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Thu, 2 Aug 2018 21:21:20 +0200 Subject: Revert "add -F and -X to default $LESS environment variable (#6611)" This reverts commit 9544316ef95c2aa1e75101a7dce545b4604b3ca6. This setting broke mouse / touchpad scroll on programs using `less` output due to it not using the alternate screen buffer. Fixes #7025 --- lib/misc.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/misc.zsh') diff --git a/lib/misc.zsh b/lib/misc.zsh index 90a8d62f3..3052b7710 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -20,7 +20,7 @@ setopt long_list_jobs ## pager env_default PAGER 'less' -env_default LESS '-FRX' +env_default LESS '-R' ## super user alias alias _='sudo' -- cgit v1.2.3-70-g09d2 From fe5fe81c8cfa66981c51d149a35fe545f2ef5016 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Sun, 9 Sep 2018 19:50:23 +0200 Subject: lib: quote arguments to env_default Fixes #7117 --- lib/misc.zsh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/misc.zsh') diff --git a/lib/misc.zsh b/lib/misc.zsh index 3052b7710..f45c10757 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -18,9 +18,8 @@ fi ## jobs setopt long_list_jobs -## pager -env_default PAGER 'less' -env_default LESS '-R' +env_default 'PAGER' 'less' +env_default 'LESS' '-R' ## super user alias alias _='sudo' -- cgit v1.2.3-70-g09d2