From 9f78a4d5a7897eb2c6fb4e060c2c36ef4587d766 Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Sat, 2 Jul 2022 05:53:58 +0200 Subject: [PATCH] Do not default to emacs if explicitly turned off (re: 1375cda9) When a user invokes 'ksh +o emacs' they should not land in the emacs line editor, as they explicitly asked not to have it. So default to no editor mode in that case. --- src/cmd/ksh93/sh/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/ksh93/sh/main.c b/src/cmd/ksh93/sh/main.c index 7ee5c63e3..1ae64ec08 100644 --- a/src/cmd/ksh93/sh/main.c +++ b/src/cmd/ksh93/sh/main.c @@ -349,7 +349,7 @@ int sh_main(int ac, char *av[], Shinit_f userinit) #if SHOPT_VSH && !sh_isoption(SH_VI) #endif /* SHOPT_VSH */ - ) + && !is_option(&sh.offoptions,SH_EMACS)) sh_onoption(SH_EMACS); #endif /* SHOPT_ESH */ }