Saturday, May 11, 2024
 Popular · Latest · Hot · Upcoming
14
rated 0 times [  14] [ 0]  / answers: 1 / hits: 12224  / 3 Years ago, tue, july 6, 2021, 1:03:08

I have a bit of an odd issue as far as I can tell. When I use tmux I don't get color within the terminal (all text is white, even for things like ls), but my colors work perfectly for vim and other things like that.



In my .tmux.conf file I have the line set -g default-terminal "screen-256color", which is what most people say solved their problems. I also tried starting tmux by typing tmux -2, but that doesn't change anything.



I'm kind of at a loss at this point, so thanks in advance for any help you can offer!



OS: Ubuntu 16.04



Tmux Version: 2.1


More From » 16.04

 Answers
0

I can help you solve the symptom, but not the root of the problem.
The design of the prompt is configured in the variable PS1.



Outside tmux, this is the value:



$ echo ${PS1} # outside tmux
[e]0;u@h: wa]${debian_chroot:+($debian_chroot)}[033[01;32m]u@h[033[00m]:[033[01;34m]w[033[00m]$


This is the value inside tmux:



$ echo ${PS1} # outside tmux
${debian_chroot:+($debian_chroot)}u@h:w$


to fix the problem, you can run this command inside tmux, and the prompt will immediately look normal for the current window:



PS1='[e]0;u@h: wa]${debian_chroot:+($debian_chroot)}[033[01;32m]u@h[033[00m]:[033[01;34m]w[033[00m]$ '


edit:
I solved it by adding the following line to ~/.tmux.conf



set -g default-terminal "screen-256color"

[#10974] Thursday, July 8, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rstride

Total Points: 305
Total Questions: 112
Total Answers: 118

Location: Mali
Member since Sat, Dec 26, 2020
3 Years ago
;