Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

1 Answer 1

up vote 2 down vote accepted

Typically, this is solved by using curses http://en.wikipedia.org/wiki/Curses_(programming_library) 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.