| Age | Commit message (Collapse) | Author |
|
New completion entry functions for readline specific code:
- compl_var for variables
- compl_fn for functions
- compl_builtin for builtins
- compl_extcmd for external commands in path
- compl_command, which combines the last three
The first three are simple wrappers for compl_name, which iterates over a
typical rc table (an array of structs) yielding the name fields.
The appropriate completion entry function is chosen based on the
character/token that preceeds the word to complete: '$' for variable,
beginning of line or one of [`@|&(){;] for command. Otherwise the shell falls
back to readline's default completion, which it also does, if the chosen
completion entry function finds no match.
|
|
|
|
edit_catcher() performs a longjmp via rc_raise() to the matching setjmp in
doit(). The latter does the same as before, so that edit_alloc() gets called
again, but this time the installation of the signal handlers trashes the old
handlers saved in the last call. Once readline() returns normally to
edit_alloc() the wrong signal handlers get restored.
The simplified call hierarchy looks like this:
doit();
sigsetjmp();
edit_alloc();
oldint = sys_signal(SIGINT, edit_catcher);
readline();
SIGINT -> edit_catcher();
siglongjmp();
sys_signal(SIGINT, oldint);
Restoring the old signal handlers in edit_catcher() solves this.
|
|
This reverts commit 90de423084757db66041175b43a59b5ff630cb50.
|
|
|
|
|