[GRASS5] [bug #1407] (grass) don't ignore C-z suspend in many forms

Glynn Clements glynn.clements at virgin.net
Sun Nov 10 04:57:13 EST 2002

Request Tracker wrote:

> Subject: don't ignore C-z suspend in many forms

> many grass programs ignore C-z, the suspend char, for no good reason, during,
> e.g. a form filling out session.  Yes, some of us might still prefer to
> use the C-z to do some quick shell commands [with the grass envronment] rather than
> start another window with their window manager.

All programs which use the vask library will behave this way, as
V_init() calls raw(), which causes the signalling codes (Ctrl-C,
Ctrl-Z etc) to be passed through to the application rather than
generating signals.

There are four plausible approaches:

1. Leave as is.

2. Don't call raw(); Ctrl-C will then (typically) generate SIGINT,
which would need to be caught. Ctrl-Z will (typically) generate
SIGTSTP, which will suspend the program; however, it is necessary to
suspend curses first (so that the terminal is usable), and resume
curses and refresh the screen upon resumption (SIGCONT). I say
"typically", because the exact codes which generate the signals can be
user configured, e.g. via stty.

3. Call raw(), but have the application explicitly handle code 26
(Ctrl-Z), similar to the handling of code 3 (Ctrl-C).

4. Similar to the previous option, but use tcgetattr(), gtty() or
ioctl(TCGETA) to read the terminal configuration rather than assuming
Ctrl-C -> SIGINT, Ctrl-Z -> SIGTSTP etc.

Glynn Clements <glynn.clements at virgin.net>

More information about the grass-dev mailing list