颜色termcaps Konsole? [英] Color termcaps Konsole?

查看:195
本文介绍了颜色termcaps Konsole?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在OpenSuse 13.2上的我的终端中有一个ANSI转义码的问题。
我的Makefile用于显示漂亮的颜色在OSX上班,但在家里,当我使用它我得到litteral termcaps如\033 [1; 30m ... \033 [0m

I've got a problem with ANSI escape codes in my terminal on OpenSuse 13.2. My Makefile use to display pretty colors on OSX at work but at home when I use it I get the litteral termcaps such as \033[1;30m ... \033[0m

我知道termcaps什么也没有,我只是发现这些转义字符似乎工作正常!最奇怪的是,我的OSX和Linux终端配置了TERM = xterm-256color,所以我真的不知道在哪里寻找正确的设置,我目前在Linux上缺少。

I know close to nothing about termcaps, I just found these escape characters that seemed to be working fine ! The strangest is that both my OSX and Linux terminal are configured with TERM=xterm-256color so I really don't know where to look for the correct setting I'm currently missing on Linux.

TL; DR:如何获取转义码,例如\033 [1; 30m在Konsole中使用xterm-256color工作?

TL;DR: How to get escape codes such as \033[1;30m working in Konsole with xterm-256color ?

Edit:这里是我说的Makefile的片段:
\Here是我所说的Makefile的一个片段:

Here's a snippet of the Makefile I am talking about: \Here's a snippet of the Makefile I am talking about:

# Display settings
RED_L = \033[1;31m
GREEN_L = \033[1;32m
GREEN = \033[0;32m
BLUE = \033[0;34m
RED = \033[0;31m

all: $(OBJ_DIR) $(NAME)

$(OBJ_DIR):
        @mkdir -p $(OBJ_DIR)

$(NAME): $(OBJ)
        @echo "$(BLUE)Linking binary $(RED)$(NAME)$(BLUE).\n"
        @$(CC) -o $@ $^ $(LFLAGS)
        @echo "\t✻ $(GRAY)$(CC) -o $(RED)$(NAME)$(GRAY) object files:$(GREEN) OK! √\n$(NC)


推荐答案

我终于找到了解决方案:

I finally found the solution:

code> echo 而不是 echo -e 这似乎是Mac OSX上默认的behaivour。

the problem was I used echo instead of echo -e which seems to be the default behaivour on Mac OSX.

感谢您的帮助,它让我参加了很好的讲座:)

Thanks for your help though, it lead me to good lectures :)

这篇关于颜色termcaps Konsole?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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