Note that an inactivity timeout may occur in any version of A-Shell, while a closed window event only applies to A-Shell/Windows.
In addition to the external events described above, there are a number of internal events which can also interrupt an application. Most BASIC errors fall into this category, but there are two special conditions for which there is no AMOS equivalent and thus deserve further discussion here: inactivity timeout and a manually closed window.
Inactivity timeout is an optional feature of A-Shell that may be activated via the IATIMEOUT System Parameter. By default, it is disabled, but when enabled, a background timer is started that checks on the application periodically to see if it has been idle for the specified duration. If so, A-Shell generates an error #254. Note that although unlike the hangup signal (error #250) in the sense that the terminal connection is still live, as a practical matter, it probably indicates that the operator has left her station and thus there is little point in displaying a message and prompting for an acknowledgement (as you might do with most other errors). This is why it was handled like the hangup and kill errors in the sample error trap routine in the preceding section. (If you think that there is a possibility that the operator is there but just not paying attention to the screen, it might make sense to ring the terminal bell a few times and then use a timed keyboard operation to give her a last chance to resume before aborting.)
Possibilities for detecting timeout conditions abound. At the individual field level, INFLD.SBR and GET.SBR both support time-limited keyboard entry. At the session level, in addition to the IATIMEOUT A-Shell system parameter, many telnet clients support an idle timeout. (In this case, the client would shut down the session and A-Shell would treat it like a disconnect.)
The Closed Window event only applies to A-Shell/Windows when OPTIONS=XABORT is set in miame.ini. In this case, the user is allowed to abort a running application by clicking on the "X" in the upper right corner, or by hitting ALT-F4. Either action in this case will trigger BASIC error #255, which should be handled, for all practical purposes, just like the kill signal (error #251).