From 3f33f0afb9f61365268462e99466ded1180d9bd9 Mon Sep 17 00:00:00 2001 From: 0xACE <0xaced@gmail.com> Date: Tue, 16 Jul 2019 04:25:01 +0200 Subject: [PATCH 1/3] stop readline from overwriting LINES The problem was that readline would completely block LINES from updating after prompting the user. I'm not entirely sure why this happened, but at least this patch fixes the problem. --- src/nnn.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nnn.c b/src/nnn.c index f37551f1..e3e3b35c 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -4783,6 +4783,7 @@ int main(int argc, char *argv[]) setlocale(LC_ALL, ""); #ifndef NORL + rl_change_environment = 0; /* Bind TAB to cycling */ rl_variable_bind("completion-ignore-case", "on"); #ifdef __linux__ From ef32cf7177e6956930edf0a185e83d4de1e34702 Mon Sep 17 00:00:00 2001 From: 0xACE <0xaced@gmail.com> Date: Tue, 16 Jul 2019 05:02:45 +0200 Subject: [PATCH 2/3] set rl_change_environment in readline gt v6.3 Looked up GNU readline library's repo and looked for the first occurance of rl_change_environment. --- src/nnn.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/nnn.c b/src/nnn.c index e3e3b35c..9cd0910a 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -4783,7 +4783,9 @@ int main(int argc, char *argv[]) setlocale(LC_ALL, ""); #ifndef NORL +#if RL_READLINE_VERSION >= 0x0603 rl_change_environment = 0; +#endif /* Bind TAB to cycling */ rl_variable_bind("completion-ignore-case", "on"); #ifdef __linux__ From 02fd4c4d8c927b574eadc3dee16ef8528e6c8297 Mon Sep 17 00:00:00 2001 From: 0xACE <0xaced@gmail.com> Date: Tue, 16 Jul 2019 05:09:11 +0200 Subject: [PATCH 3/3] documentation on rl_change_environment Basically that line lets nnn retain the WINCH signal for itself. --- src/nnn.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nnn.c b/src/nnn.c index 9cd0910a..ecb94722 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -4784,6 +4784,7 @@ int main(int argc, char *argv[]) #ifndef NORL #if RL_READLINE_VERSION >= 0x0603 + /* readline would overwrite the WINCH signal hook */ rl_change_environment = 0; #endif /* Bind TAB to cycling */