mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
edit: do not enable multiline mode with no editor active
If neither gmacs/emacs nor vi are active, the multiline mode should not be enabled even if the multiline option is on. Doing so can cause inconsistent behaviour, particularly in multibyte locales where, if the shell is compiled with SHOPT_RAWONLY (as is default), the no-editor mode is actually handled by vi.c. Also, the new --histreedit and --histverify options only work in the emacs or vi editors, or in no-editor mode when handled by vi. Which means they cannot ever work if neither emacs or vi were compiled in (i.e. SHOPT_ESH and SHOPT_VSH were both disabled). In that case, there's no point in compiling in those options. Come to think of it, the same applies to the multiline option. All changed files: - Update SHOPT_ESH/SHOPT_VSH preprocessor directives as per above. src/cmd/ksh93/include/defs.h, src/cmd/ksh93/include/shell.h: - Move definitions of history expansion-related options to shell.h, which is where all the other shell options are defined.
This commit is contained in:
parent
a5700d3937
commit
b509e92241
9 changed files with 52 additions and 20 deletions
|
|
@ -103,12 +103,6 @@ extern char* sh_setenviron(const char*);
|
|||
#define SH_TYPE_PROFILE 020
|
||||
#define SH_TYPE_RESTRICTED 040
|
||||
|
||||
#if SHOPT_HISTEXPAND
|
||||
# define SH_HISTEXPAND 43
|
||||
# define SH_HISTREEDIT 61
|
||||
# define SH_HISTVERIFY 62
|
||||
#endif
|
||||
|
||||
#ifndef PIPE_BUF
|
||||
# define PIPE_BUF 512
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -135,7 +135,9 @@ typedef struct edit
|
|||
int e_stkoff; /* saved stack offset */
|
||||
char **e_clist; /* completion list after <ESC>= */
|
||||
int e_nlist; /* number of elements on completion list */
|
||||
#if SHOPT_ESH || SHOPT_VSH
|
||||
int e_multiline; /* allow multiple lines for editing */
|
||||
#endif
|
||||
int e_winsz; /* columns in window */
|
||||
Edpos_t e_curpos; /* cursor line and column */
|
||||
Namval_t *e_default; /* variable containing default value */
|
||||
|
|
|
|||
|
|
@ -133,8 +133,17 @@ typedef union Shnode_u Shnode_t;
|
|||
#if SHOPT_BRACEPAT
|
||||
#define SH_BRACEEXPAND 42
|
||||
#endif
|
||||
#if SHOPT_HISTEXPAND
|
||||
#define SH_HISTEXPAND 43
|
||||
#if SHOPT_ESH || SHOPT_VSH
|
||||
#define SH_HISTREEDIT 44
|
||||
#define SH_HISTVERIFY 45
|
||||
#endif
|
||||
#endif
|
||||
#define SH_POSIX 46
|
||||
#if SHOPT_ESH || SHOPT_VSH
|
||||
#define SH_MULTILINE 47
|
||||
#endif
|
||||
#define SH_NOBACKSLCTRL 48
|
||||
#define SH_LOGIN_SHELL 67
|
||||
#define SH_NOUSRPROFILE 79 /* internal use only */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue