#3745: Preferences : "[x] Warn upon closing active programs" ------------------------------------+--------------------------------------- Reporter: mmadia | Owner: jackburton Type: enhancement | Status: new Priority: normal | Milestone: R1 Component: Applications/Terminal | Version: R1/pre-alpha1 Resolution: | Keywords: Blocked By: | Has a Patch: 0 Platform: All | Blocking: ------------------------------------+--------------------------------------- Comment (by bonefish): Replying to [comment:4 jackburton]: > More useful would be what the Gnome Terminal do. > If you have an active program executed in the shell (for example, a ssh or telnet session), it warns you (on close) that there is something active. Not sure whether that's always what one would want, but I guess it's probably the least annoying while protecting programs from being killed by accident. > I thought waitpid() could be used to check that, but I probably misread the documentation. You might be interested in [http://www.opengroup.org/onlinepubs/9699919799/functions/tcgetpgrp.html tcgetpgrp()]. If the terminal's foreground group is not the shell, then something else is actively running. That doesn't catch stopped or background jobs, though. You could test what Gnome Terminal does in these situations. Well, or look in its source code. It might make use of procfs, though, which we don't have. -- Ticket URL: <http://dev.haiku-os.org/ticket/3745#comment:5> Haiku <http://dev.haiku-os.org> Haiku - the operating system.