如何加载ANSI转义代码或获取彩色文件列表在WinXP cmd shell? [英] How to load ANSI escape codes or get coloured file listing in WinXP cmd shell?

查看:329
本文介绍了如何加载ANSI转义代码或获取彩色文件列表在WinXP cmd shell?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这与问题: 如何在Windows cmd shell中获得彩色文件列表?

我想尝试获取,文件列表在windows cmd shell中。 Windows是XP SP2,如果这很重要。

在旧的DOS日子里,曾经有一些程序像hdir,adir和这样的显示那么漂亮。现在,这样的程序已经没有了。

I'm trying to get, wouldn't you believe it, coloured file listing in windows cmd shell. Windows are XP SP2, if that matters.
In the old DOS days there used to be little programs like hdir, adir and such which displayed that nice. Nowadays, such programs are no more.

但是,还有unixkit-tiny或unixtools的 ls 。 Unfortunatelly,它使用ANSI转义码来显示颜色,而cmd不能很好地处理这些颜色。

There is however, ls, from unixkit-tiny or unixtools. Unfortunatelly, it uses ANSI escape codes for displaying colours, and cmd doesn't handle those too well.

有几种解决方案,包括加载ansi.sys和command.com ,但是command.com没有处理很长的文件名,并且非常慢。即使这样,有时它显示颜色有问题。

There are several solutions which include loading ansi.sys and command.com, but command.com doesn't handle long filenames that well, and is awfully slow. Even then sometimes it has problems displaying colours.

所以我问,有一种方法可以得到彩色文件列表在Windows cmd shell,除了使用cygwin?或者有办法让ANSI转义代码以一种方式使用cmd.exe,这样本机 ls 才能正常播放?

So what I'm asking, is there a way to get coloured file listing in windows cmd shell, apart from using cygwin ? Or is there a way to get ANSI escape codes to work with cmd.exe in a way so that native ls will play nicely ?

推荐答案

我在 http:// adoxa时遇到ANSICON .110mb.com / ansicon / index.html ansicon github repo

使用它来着色NAnt输出。 ls - color正在正确处理。

Using it to colorize NAnt output. ls --color is being processed correctly.

提供了源代码,但我没有检查它。

Source code is provided, but I haven't examined it.

这篇关于如何加载ANSI转义代码或获取彩色文件列表在WinXP cmd shell?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆