From 7e3fdf33ec53821e574b8d6df43bec7264c507ee Mon Sep 17 00:00:00 2001 From: Bernard Grymonpon Date: Mon, 27 Nov 2023 11:07:51 +0100 Subject: fix(misc): only set PAGER if `less` or `more` are available (#12060) --- lib/misc.zsh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/misc.zsh b/lib/misc.zsh index 132f33551..ff2017713 100644 --- a/lib/misc.zsh +++ b/lib/misc.zsh @@ -19,8 +19,13 @@ setopt multios # enable redirect to multiple streams: echo >file1 > setopt long_list_jobs # show long list format job notifications setopt interactivecomments # recognize comments -env_default 'PAGER' 'less' -env_default 'LESS' '-R' +# define pager dependant on what is available (less or more) +if (( ${+commands[less]} )); then + env_default 'PAGER' 'less' + env_default 'LESS' '-R' +elif (( ${+commands[more]} )); then + env_default 'PAGER' 'more' +fi ## super user alias alias _='sudo ' -- cgit v1.2.3-70-g09d2 From 1ae0515a80686d33406c9a2c58c0c9666ca47c77 Mon Sep 17 00:00:00 2001 From: Marc Cornellà Date: Wed, 6 Dec 2023 08:09:45 +0100 Subject: fix(lib): patch `omz_urlencode` to not encode UTF-8 chars in Termux (#12076) Fixes #12061 --- lib/functions.zsh | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib') diff --git a/lib/functions.zsh b/lib/functions.zsh index a252d0a33..f5c671f9c 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -182,6 +182,8 @@ function omz_urlencode() { fi # Use LC_CTYPE=C to process text byte-by-byte + # Note that this doesn't work in Termux, as it only has UTF-8 locale. + # Characters will be processed as UTF-8, which is fine for URLs. local i byte ord LC_ALL=C export LC_ALL local reserved=';/?:@&=+$,' @@ -206,6 +208,9 @@ function omz_urlencode() { else if [[ "$byte" == " " && -n $spaces_as_plus ]]; then url_str+="+" + elif [[ "$PREFIX" = *com.termux* ]]; then + # Termux does not have non-UTF8 locales, so just send the UTF-8 character directly + url_str+="$byte" else ord=$(( [##16] #byte )) url_str+="%$ord" -- cgit v1.2.3-70-g09d2