Cross-platform window-Watcher for Linux (X11), macOS, Windows.
Note to macOS users
To log current window title the terminal needs access to macOS accessibility API.
This can be enabled in
System Preferences > Security & Privacy > Accessibility, then add the Terminal to this list. If this is not enabled the watcher can only log current application, and not window title.