You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you run a command and pipe its standard output (stdout) to less for a paged view (e.g. pacman -Qe | less), you may find that the output is no longer colored. This is usually because the program tries to detect if its stdout is an interactive terminal, in which case it prints colored text, and otherwise prints uncolored text. This is good behaviour when you want to redirect stdout to a file, e.g. pacman -Qe > pkglst-backup.txt, but less suited when you want to view output in less.
The text was updated successfully, but these errors were encountered:
如下图,如果想在Qt应用中显示运行日志的话,使用QProcess读到的运行日志是带有ANSI转义符的,输出到文本框后就会看起来一团糟。
同样,将运行日志输出至文件(例如
unblockneteasemusic-win-x64.exe > log.txt
)时,输出的日志仍然带有ANSI转义符。是否能像GCC一样,在输出到非TTY设备时,输出未经ANSI转义的纯文本?
详见:Color output in console - ArchWiki
The text was updated successfully, but these errors were encountered: