Created
January 29, 2011 12:15
-
-
Save ratazzi/801785 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bash 颜色 | |
\e[01;37mstring\e[00m | |
\e 高级选项输出到窗口 (PHP,Python 中用 \033 代替) | |
[ 非打印字符开始 | |
] 非打印字符结束 | |
string 待打印的字符串 | |
样式代码 | |
01;37m | |
m 表示结束 | |
\e[00m 恢复正常 | |
第一组: | |
00 普通 | |
01 高亮 | |
02 闪烁 | |
04 下划线 | |
07 使用较淡的颜色作为背景 | |
09 删除线 | |
第二组: | |
30 black | |
31 red | |
32 green | |
33 brown | |
34 blue | |
35 purple | |
36 cyan | |
37 white | |
备注:上面的 3 替换成 4 的话,就是相应的背景色 | |
高级用法(同时使用前景色,背景色):01;37;46m | |
控制字符: | |
\033[nA 光标上移 n 行 | |
\033[nB 光标下移 n 行 | |
\033[nC 光标右移 n 行 | |
\033[nD 光标左移 n 行 | |
\033[y;xH 设置光标位置 | |
\033[2J 清屏 | |
\033[K 清除从光标到行尾的内容 | |
\033[s 保存光标位置 | |
\033[u 恢复光标位置 | |
\033[?25l 隐藏光标 | |
\033[?25h 显示光标 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment