Disable CTRL G

Sean Hinde sean.hinde@REDACTED
Tue Dec 2 17:12:16 CET 2003


Peter,

> The restricted shell mode + "ignore break" is indeed there for
> protection against simple operator mistakes. Pressing 'q' and stopping
> the node in e.g. an attempt to exit the job control (JCL) mode, could
> very well happen by mistake.

Indeed. It has.

>
> So, speaking of mistakes, not being able to disable the JCL quit option
> - that's one for sure. Bugger.
>
> Here's my suggestion: The ignore break flag, erl +Bi, is already used
> for disabling ^C break/stop of the system. Let's have the same flag 
> also
> disable any shell shortcut for stopping the system (that'd be the JCL
> quit option). After all, it's the same kind of "halt by accident" from
> the shell that we'd be trying to avoid. Do you agree? If so, I'll get 
> to
> it.

I think that there is a distinction between "Safe" JCL functions and 
"Unsafe" JCL functions. I would categorise safe ones as:

c
i
k
j
s
? | h

and unsafe as r [node] and q

Other peoples definitions of safe/unsafe might be different. I guess 
the ultimate solution would be to be able to define a function in the 
restricted shell callback to allow or deny each of these options or 
even to drop back to an old_shell like mode where CTRL-G just gives you 
a new shell if you have buggered up the old one in some way.

A minimal solution could well be to link this to the +Bi option, or 
perhaps better to provide a +G [i] option.

> Until it's fixed, you know ^G in a primitive Erlang shell (erl
> -oldshell) will only restart the current evaluator, not bring up the 
> JCL
> menu? So you get no halt() shortcuts when using a restricted oldshell
> ignoring break (erl -oldshell -stdlib restricted_shell <mod> +Bi).

Actually this shell looks OK for operator usage - I quite like the fact 
that multiline commands do not give you back the 1> prompt until they 
are terminated. Alternatively this might lead to more confusion ("The 
shell has died, I'll have to restart the node!").

Let's go for some sensible way to neuter CTRL-G and I'll experiment 
with old_shell in the meantime.

Thanks very much,

Sean




More information about the erlang-questions mailing list