On Jan 3, 2008 12:13 PM, Michael <misha / onet.ru> wrote:
> Hello, folks.
>
> I'm trying to write simple CLI program which will be some kind of
> chat, but i have faced with some output problem.
> Is it possible to output over current line in stdout?


STDOUT.write "\rThis will overwrite the current line"

The "\r" is the carriage return character, and it will return the
insert point to the beginning of the current line. The only caveat is
that the new line you are writing needs to be at least as long as the
line you wish to overwrite. If it is not, you will have remnants of
the previous line at the end of your output.

Another option would be to use the "highline" gem.

Blessings,
TwP