From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Can Ada print coloured/styled text to the terminal? (ANSI escape sequences?) Date: Tue, 7 Aug 2018 10:33:44 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <810948b7-1370-4c0d-aaf3-ed66b7dfbba5@googlegroups.com> NNTP-Posting-Host: IzvqdhUtDGKIMCldyDtZ+w.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 X-Notice: Filtered by postfilter v. 0.8.3 Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:54080 Date: 2018-08-07T10:33:44+02:00 List-Id: On 2018-08-07 00:15, Randy Brukardt wrote: > wrote in message > news:810948b7-1370-4c0d-aaf3-ed66b7dfbba5@googlegroups.com... > >> You can also take a look at GNATCOLL.terminal, in the GNAT >> Components Collection. It will do colors either using ansi escape >> sequences or, on Windows, proper system calls. In terms of >> portability, better to think early on that not all terminals support >> escape sequences... > > And they don't all support the same escape sequences, either. But most > important is that Windows almost never supports escape sequences, so any > code that you want to be reasonably portable has to avoid them. I didn't test it, because the idea to use character terminal in XXI century is beyond silly, but I heard that Windows 10 cmd has them enabled. It took less than 3 decades to do, but they finally managed it! On older versions ANSI.SYS driver is required. > (If you want > it really portable, that is to work with other Ada compileers, you have to > avoid GNATCOLL, too, since it is GNAT-specific.) There are lots of GUI frameworks with Ada support for Windows as well as raw Windows GDI bindings. No reason to mess with terminal commands. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de