1. Home
  2. User Experience
  3. Setting Inactivity Rules

Setting Inactivity Rules

The following options are available to help automate or prevent user sessions from being ended automatically:

  • Inactivity timer for the host entry
  • Inactivity timer for a specific screen
  • Set an SSH keep-alive timer
  • Set an automated inactivity response script

Emulation Property Setup

StayLinked has the ability to end inactive sessions as an 'Emulation Property' in the telnet host entry. Navigate to Emulation Settings > Telnet Host Groups. Select your Telnet Host Group. Select your host name, next right-click on it and choose 'Edit'.

Under Emulation Properties, right-click to 'Add New'. Select "Telnet Session Inactivity Timeout". The value entered would be the inactive time elapsed in seconds. (In this example we used 3 hours, 10,800 seconds.) Click OK.

When StayLinked ends a session due to inactivity it is recorded in the Server Alerts section of the Administrator.

If you have the same reaction using other clients like PuTTy, the inactivity timeout may be on the host side. StayLinked cannot prevent the host from hanging up on the telnet session.

An inactivity script can also be added. This emulation property instructs StayLinked what inputs to provide to the host prior to closing the telnet session. This is often used when the host has common keys for backing out of transactions prior to closing the session.

Instructional Video: Setting an Inactivity Timeout with Emulation Property

Screen Recognition Setup

Using Screen Recognition features you can set an inactivity timeout based on the screen presented by the host.

This is more often used on sign-on screens in which the user has not started any work and the session can be easily ended without need to clean up incomplete activities. This option does not provide a scripting option before ending the session. Here is the link to the articles for our screen recognition guide. For specific details on these steps start with Capturing Screen Maps in the overview article.

Note that the only tab required in screen recognition is the 'Recognition Strings' to identify the location of your username and/ or password prompts.

If you have any users that are presented with a choice of telnet servers or hosts, these settings would not yet apply because no host entry has been selected. StayLinked offers a 'pre-telnet timeout' which can be configured in the server settings to clean up inactive sessions that might sit before selecting a host or when displaying early server-side error messages.

Note that all of these values are configured in seconds. When a telnet session has started, it is recommend that no timeout is used short enough to interrupt incomplete user activities. Common values include 4 or 8 hours, configured in seconds as 14400 or 28800. Pre-ternet or signon screens can be configured for much shorter times since you know the user has not started any work, commonly as 300 seconds for a 5 minute timeout.

Preventing Inactivity Timeouts

Some environments may be configured with timing restrictions. StayLinked supports two options for preventing disconnections due to delays in user input.

SSH-Based Communication Inactivity

The most common is SSH keepalive configuration within the terminal emulation protocol. When using the VT-SmartTE emulation type, an emulation property can be added to the list box at the bottom of the host entry to set this time interval. Note that the time should be lower than the required values of the host system to prevent disconnections.

Host-Side Timed Communication

It may sometimes be necessary to automate input to the host related to inactivity periods. StayLinked provides support for a Telnet Session Inactivity Script as a supplemental emulation property. This script provides input based on the Telnet Session Inactivity Timeout setting.

Common implementation of this script allows for input of keystrokes to be provided before the session is terminated. This might be something like [pf3][pf3][pf3][pf3] to perform four function 3 inputs, common in 5250 emulation as a cancel, moving back up to four screens before ending the session to make sure records are not locked open by the session ending.

Starting in version 16.2, the script now supports a special [keep-alive] mnemonic to the beginning of the script to tell the SmartTE Server to run the script and then restart the timer for the Inactivity Timeout. This new [keep-alive] mnemonic is extended to specify how many times to repeat the keep-alive, followed by the desired input/transaction to the host system.

For example,

[keep-alive]abc[tab]123 – This entry would run the keepalive script, typing abc[tab]123 every time the inactivity timer is reset, never terminating the session since no count has been entered for the keep-alive mnemonic.

[keep-alive 4][hex 01] – This causes the Inactivity Timeout to perform a keep-alive for four cycles and then revert to an inactivity timeout. The first four times that the 'Telnet Session Inactivity Timeout' expires, the SmartTE Server will send the [hex 01] script to the host system and then reset for a new 'Telnet Session Inactivity Timeout' (Keep-Alive) cycle. After four keep-alives, the next timeout will perform a normal inactivity timeout and send the [hex 01] to the host as an inactivity script. Also, in this case, any user input to the telnet session will reset the keep-alive cycle counter so that the next inactivity will perform the first keep-alive cycle again.

Updated on February 9, 2026

Related Articles