clarification Required in Write command

Hi All,
can you please help me to get clarified about the 'write' command.

I have a script that sends a content of a file msg.txt to other user 'User B' using 'write' command.

Script:
------
.....
cat msg.txt | write "user B"
.....

Issue: I face a issue here, this scripts sends message to user B successfully. But the message is interuppting user B even if he is busy doing other jobs or even if he is 'vi' some files.
so the message is not clear to the user.

please clarify me on the below things:
1. Can I send the message as a pop up
2. Can I send a colored text to differentiate the message content.
3. Can I let the terminal of User-B to blink upon sending the message.
4. Can I clear the message content from his terminal if he hits Ctrl+c.
5. Please assist me to know whether I can achieve sending a pop up message to other terminals using any other commands.

Thanks in advance for all of your support and assistance.!! :b:

Assuming that the user is using a PC running a windows terminal emululation program.
You have to write a Visual Basic program that accepts input from the command line, and displays the message in a popup window.
Re work the write command so that it invokes the program.
Some emulators will allow this in their escape sequences Anita from http://april.se, and here http://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/osc.html

  1. What's a pop-up for you? write, as specified by the OpenGroup, doesn't know anything about "Windows", only terminals.
  2. Yes, you can. However, you'd have to send the command codes for the appropriate remote terminal as part of the message, and even then it's not guaranteed to work. See ANSI escape codes for details
  3. See 2. Just a matter of the sequences sent
  4. Again, see 2.
  5. Again, what's a pop-up for you? If the other user has an open X11 display, and you're allowed to connect to it, you could use xmessage.

Thank you so much for both of your responses.
:b: