单色应用程序是否支持 256 色终端?
我的程序在 256 色环境中给出了非常奇怪的输出。
如果它是 256 色,我应该只检查 $TERM 值并完全禁用颜色吗?
我的输出如下所示:
1%{8}%<%t37%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;7%;m1%{8}%<%t31%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;1%;mYou have not registered
1%{8}%<%t37%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;7%;m1%{8}%<%t31%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;1%;mMOTD File is missing
1%{8}%<%t37%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;7%;m1%{8}%<%t30%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;0%;mThetis joined #sanctuary.
1%{8}%<%t37%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;7%;m1%{8}%<%t36%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;6%;mPlugin - Factoids - Saved.
1%{8}%<%t37%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;7%;m1%{8}%<%t36%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;6%;mPlugin - Factoids - Saved.
1%{8}%<%t37%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;7%;m1%{8}%<%t30%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;0%;mChanMess 77 and still going...
1%{8}%<%t37%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;7%;m1%{8}%<%t36%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;6%;mPlugin - Factoids - Saved.
1%{8}%<%t37%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;7%;m1%{8}%<%t36%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;6%;mPlugin - Factoids - Saved.