digitalmars.D.learn - Using ANSI codes
- Funog (1/1) Nov 03 2009 How can I get a D1 console program to use ANSI codes? Currently it just ...
- Stewart Gordon (8/9) Nov 03 2009 At first I thought you meant the ANSI character set, but then I realised...
- funog (2/15) Nov 03 2009 You are right. I was using Vista Premium, but it works fine on linux.
- Daniel Keep (4/20) Nov 05 2009 http://github.com/DanielKeep/gb/blob/master/src/gb/io/Ansi.d
-
Stewart Gordon
(16/17)
Nov 07 2009
How can I get a D1 console program to use ANSI codes? Currently it just prints the escape character like any other...
Nov 03 2009
Funog wrote:How can I get a D1 console program to use ANSI codes? Currently it just prints the escape character like any other...At first I thought you meant the ANSI character set, but then I realised you're probably talking about ANSI.SYS. This is an operating system issue, not a D issue. What OS version are you using? Try searching the web for info related to yours. Alternatively, check out disp.h, which comes with DMC, and use that instead. I once began writing D bindings for it.... Stewart.
Nov 03 2009
Stewart Gordon Wrote:Funog wrote:You are right. I was using Vista Premium, but it works fine on linux.How can I get a D1 console program to use ANSI codes? Currently it just prints the escape character like any other...At first I thought you meant the ANSI character set, but then I realised you're probably talking about ANSI.SYS. This is an operating system issue, not a D issue. What OS version are you using? Try searching the web for info related to yours. Alternatively, check out disp.h, which comes with DMC, and use that instead. I once began writing D bindings for it.... Stewart.
Nov 03 2009
funog wrote:Stewart Gordon Wrote:http://github.com/DanielKeep/gb/blob/master/src/gb/io/Ansi.d Should stand on its own, but only works with Tango. -- DanielFunog wrote:You are right. I was using Vista Premium, but it works fine on linux.How can I get a D1 console program to use ANSI codes? Currently it just prints the escape character like any other...At first I thought you meant the ANSI character set, but then I realised you're probably talking about ANSI.SYS. This is an operating system issue, not a D issue. What OS version are you using? Try searching the web for info related to yours. Alternatively, check out disp.h, which comes with DMC, and use that instead. I once began writing D bindings for it.... Stewart.
Nov 05 2009
Daniel Keep wrote:http://github.com/DanielKeep/gb/blob/master/src/gb/io/Ansi.d<snip> I noticed this comment: /* We only need to override write for Windows, since it's the only OS * that doesn't understand ANSI. The ONE spot where 9x is better than * NT... */ This is incorrect - ANSI.SYS is still included in modern Windows versions, at least up to Vista; the only difference is whether it's switched on by default. But libraries such as yours at least mean that the codes will work regardless of whether the end user has ANSI.SYS switched on. But disp.h, which I've already mentioned, also has the same advantage. So unless the OP is porting an app that already uses ANSI codes, or writing a terminal emulator or something.... Stewart.
Nov 07 2009