본문 바로가기
데브옵스 이야기/terminal

Ghostty에서 k9s가 요상한 색상으로 보인다면?

by lakescript 2025. 2. 3.
728x90

 

들어가며

 
저는 실무에서도 k9s를 애용하고 있는 사람으로써 당연히 ghostty에서도 k9s를 사용하려고 했는데요. iterm2에서는 정상적인 color로 보이지만, ghostty를 사용하면 위의 사진과 같이 color가 요상하게 보이는 이슈가 발생했습니다.
 
 

실제로 논의 중인 이슈잖아?!?

 
https://github.com/derailed/k9s/issues/3049

 

Wrong colors in ghostty · Issue #3049 · derailed/k9s

Describe the bug Wrong colors in ghostty. I set the background color to #ff0000 and took a screenshot in ghostty and wezterm. Wezterm uses the correct color. This fixes the problem: TERM=xterm-256c...

github.com

 
 
https://github.com/ghostty-org/ghostty/discussions/3470

 

How to fix mc colors? · ghostty-org ghostty · Discussion #3470

This is comparison of Ghostty and old terminal I use: All other old terminals show nice dark blue colors for midnight commander. In Ghostty it is too light. How can I change it to the old style?

github.com

 
 
해당 이슈는 실제로 k9s 프로젝트와 ghostty 프로젝트에서 논의 중인 문제였는데, Ghostty의 기본 TERM 설정인 xterm-ghostty로 인해 k9s과 같은 도구들의 색상이 다르게 보여지는것이 원인이었습니다.
 

iterms2에서의 TERM 환경변수

 

ghostty에서의 TERM 환경변수

 
 

해결법

해결법은 간단합니다.
 

export TERM=xterm-256color

 
.zshrc 파일에서 TERM 환경변수 값을 xterm-256color으로 지정하고, 적용시켜줍니다.
 

원래의 색으로 보여지는 것을 확인하실 수 있습니다!
 
 
 
 
 

728x90