Hi - I think the catch is that for Konsole to handle that itself, it would theoretically have to inspect what’s happening inside the terminal, and infer that status. Ideally, I think programs that are harmed by sleep occurring should set that inhibition themselves.
If you have terminal applications that aren’t set up to do that, you can still inhibit sleep directly using systemd-inhibit .
Yes, ultimately only the programs themselves know what they are doing.
The terminal could “make a guess” and inhibit sleep if it has any program running and is the focused window (e.g. the user might actively be watching top)
The terminal or shell could potentially have some sort of whitelist for programs that are usually blocking on I/O or some other long running task but such a list could grow quickly.
Some programs have different modes of operation, some of which would benefit from that while others would not.
For example a file manager like Midnight Commander: idle unless some operations is triggered by the user.
The kernel, or something intercepting system API calls, might theoretically be able to detect common patterns of IO activity that last longer, e.g. sequence of reads on a large file or holding a connected socket.
However, without knowing what the actual task is, this is potentially also brittle.
If the reads stop, for example, does that mean the program is done with IO or just processing what it has read so far?
The most feasible workaround is probably to have shell aliases which use systemd-inhibit and the actual command, leaving it up to the user to tell the system “I want this done without interruption”.