Skip to content

SessionKeep is a Windows utility designed for use within Remote Desktop (RDP) sessions. Its purpose is to prevent sessions from locking or disconnecting due to user inactivity.

License

Notifications You must be signed in to change notification settings

ENV117/SessionKeep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SessionKeep

Overview

SessionKeep is a Windows utility designed for use within Remote Desktop (RDP) sessions. Its purpose is to prevent sessions from locking or disconnecting due to user inactivity.

The application executes in the background and resides in the system tray. It continuously monitors user activity and responds when the session remains idle.

If no activity is detected for a period exceeding 60 seconds, SessionKeep may generate subtle input events. For example, the application may move the mouse by a few pixels or dispatch non-disruptive key events designed not to modify user input.

Generation of simulated input is configurable. When simulation is disabled, SessionKeep retains functionality intended to reduce the likelihood of session locks or disconnects.

Features

The application exposes the following commands via the tray icon context menu:

  • Start — Enable inactivity monitoring. When enabled, the utility detects inactivity intervals longer than 60 seconds and may simulate input to maintain the session.
  • Stop — Disable monitoring and input simulation.
  • Mouse movement — Enable or disable small, nearly imperceptible simulated mouse movements.
  • Keyboard presses — Enable or disable non-intrusive simulated key presses.
  • Dark Mode — Toggle the user interface theme between light and dark variants.
  • Exit — Terminate the application.

Compatibility

The application has been validated on 64-bit editions of Windows 10 and Windows 11, and on Windows Server 2016, 2019 and 2022.

Building

SessionKeep is implemented in C for the Win32 API and employs CMake for project configuration. The recommended development environment is MSYS2 with either Clang or GCC.

Recommended MSYS2 packages (examples):

  • mingw-w64-x86_64-cmake
  • mingw-w64-x86_64-gcc (or mingw-w64-x86_64-clang)
  • mingw-w64-x86_64-make

Build instructions (MSYS2 terminal):

  1. Change directory to the project root (the directory that contains CMakeLists.txt).

  2. Configure and build the project:

cmake -DCMAKE_BUILD_TYPE=Release -B build/Release
cmake --build build/Release

The resulting executable SessionKeep.exe will be produced in build/Release. To produce a debug build, specify -DCMAKE_BUILD_TYPE=Debug and build the corresponding output directory build/Debug.

Registry configuration (client machine)

The following instructions apply to the 64-bit Microsoft Remote Desktop Connection client (mstsc.exe) on the local (client) system.

To ensure SessionKeep remains effective when the Remote Desktop client window is minimized, set the following registry value on the client:

Registry key:

HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client

Value name: RemoteDesktop_SuppressWhenMinimized (DWORD)

Value: 2

Procedure using Registry Editor (regedit.exe):

  1. Open Registry Editor.
  2. Navigate to the key specified above.
  3. If RemoteDesktop_SuppressWhenMinimized does not exist, create a 32-bit DWORD entry with that name.
  4. Set the entry value to 2 (decimal).

Why this is necessary

By default, the Remote Desktop client may pause or "suppress" activity when its window is minimized. Setting RemoteDesktop_SuppressWhenMinimized to 2 prevents such suppression. Consequently, applications executing within the RDP session (including SessionKeep) are permitted to continue operating and, where configured, to generate input events.

Reference: https://learn.microsoft.com/en-us/answers/questions/2196906/how-to-prevent-minimized-rdp-sessions-from-freezin

About

SessionKeep is a Windows utility designed for use within Remote Desktop (RDP) sessions. Its purpose is to prevent sessions from locking or disconnecting due to user inactivity.

Resources

License

Stars

Watchers

Forks

Packages

No packages published