Does Windows console supports ANSI?

五迷三道 提交于 2019-12-10 10:27:15

问题


Does the Windows console supporsts ANSI control characters?


回答1:


It doesn't support many ANSI control characters by default (which is also mentioned in the wikipedia article http://en.wikipedia.org/wiki/ANSI_escape_code), but there are ways to make that possible.

Look into the answers to this question: How to load ANSI escape codes or get coloured file listing in WinXP cmd shell? You might happen upon something useful.




回答2:


I assume you're referring to ASCII control characters.

The answer is "some". You can read backspace keypresses, for example, and you can pipe-in things like the ASCII "Bell" character.

However if you mean that the Windows console automatically resolves escaped characters, such as converting "\b" into "Bell", then no, you have to do that yourself.

Note that I speak about entering keypresses directly into the console and not batch files, for that see @ProblemFactory's answer.



来源:https://stackoverflow.com/questions/12323678/does-windows-console-supports-ansi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!