konsole and bash script: attracting user attention when input is needed

Project:Linux software
Component:Documentation
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Related pages:#303: Bash :-:-: #5624: Konsole
Tags:bash script, konsole
Description

How to have a script run in a console tab, and attract the user attention when the script needs user input?

Use case:
in my scripts, I have sudo commands. When the last sudo ran a short while ago, it goes without a hitch. But sometimes, the script is stuck at the password prompt and I need a way to attract the user attention so that he can enter the password.

I can echo a bell just before the sudo command but:
1- the bell will ring whether or not user interaction is needed (sudo may not need user input).
2- the speakers may not be on.
3- I'd like a way for the script to interact with the konsole, so that the tab running the script flashes or something.

Konsole's feature to warn on silence/activity is not adequate enough, although it'd be cool to enable such a feature from within the script itself!