The `bash`, `ksh`, and `zsh` shells all interpret the environment variable `TMOUT`, if set to a positive integer, as the maximum number of seconds to wait for a command in an interactive shell before exiting due to idleness. They issue a warning message, but you will not see it as your terminal will disappear. `ksh` seems to provide an extra 60 seconds after the warning.
The same variable is used to set the default timeout for `read` and `select` in `bash` scripts.