On Sunday, 28 March 2021 at 17:13:02 UTC, Mark Lagodych wrote:
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.

Thank you. Seems like \033[<n>A\r does work.

Reply via email to