1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-02-13 19:52:20 +00:00
cde/src
Martijn Dekker f51e54828e sh_exec(): do not turn off editors for path-bound builtins
Here's another one from the "question everything" department.

Every time ksh executes a built-in, it checks whether it is bound
to a path (the name contains a '/') and if so, it turns off the vi,
emacs and gmacs shell options before executing it. After executing
the built-ins, those shell options are restored again. The comment
is: "turn off editors for built-in versions of commands on PATH".

But why? Commands do not and cannot ever use the command line
editors. They are only ever executed on an interactive shell
*between* running commands. So turning them off during the
execution of a command makes no difference.

The only possible effect is that these commands cannot check if a
user has the vi, emacs or gmacs option on, or change these options
itself. But what purpose could that limitation possibly serve? And
what sense does it make to do this for path-bound built-ins only
and not for other commands? And what sense does it make to have
this limitation only for the editor shell options and not others?

This waste of CPU cycles has been there since the beginning of the
ksh93-history repo (1995) so if there was ever any good reason for
it, it has been lost in the mist of history. I'm 99.999% sure that
nothing will happen after deleting this.
2022-06-10 11:34:17 +01:00
..
cmd sh_exec(): do not turn off editors for path-bound builtins 2022-06-10 11:34:17 +01:00
lib Another round of minor tweaks and cleanups 2022-06-09 03:02:06 +01:00
Mamfile Restore full 'bin/package test' functionality 2022-03-11 21:17:03 +01:00