Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i have written a tcp/ip chat program but i have a problem. On client program while user writing message, a background thread receives messages from an other client and writes the message to terminal. The problem arises when client starts typing message and before he/she presses the return key incoming message overlaps the message. How can i prevent this. Is it possible to write incoming message without overlapping the message being written?

share|improve this question
up vote 2 down vote accepted

Typically, this is solved by using curses to write the messages in a different part of the terminal than where the input is being typed in.

share|improve this answer
Thank you very much. – Olcay Ertaş Jun 16 '11 at 9:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.