How to update terminal output?

Mark Lagodych lgd.mrk at gmail.com
Sun Mar 28 17:13:02 UTC 2021


On Sunday, 28 March 2021 at 16:45:29 UTC, dog2002 wrote:
> I mean, I want to write a string without a new line. For 
> example, some command line applications have progress bars.
>
> For a single line string I use \r. But it doesn't work for a 
> multiple line string - the application is just adding new lines.

See http://www.climagic.org/mirrors/VT100_Escape_Codes.html
Basically, you just need to do this:

writeln("\033[" ~ cmd);

where cmd is your VT100 command and \033 is an Escape character.

Although some (all?) of that commands do not work in the Windows 
terminal. For instance, you can change background color ONLY 
using Windows API.


More information about the Digitalmars-d-learn mailing list