LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Start tmux on Login - with 256 colors (https://www.linuxquestions.org/questions/linux-newbie-8/start-tmux-on-login-with-256-colors-4175448803/)

Jean-Luc Besson 02-05-2013 11:24 PM

Start tmux on Login - with 256 colors
 
Hi There,

I'm currently running Ubuntu 12.04 and had that idea starting tmux on every shell login...with 256 colors.

Unfortunately,...while browsing different forums, blogs, stackoverflow...I got completely lost. Depending on where I put the following commands in my .bashrc I can either have the 256 colors OR tmux on login.

Quote:

### .bashrc
# COLORSCHEME 256
#====================
export TERM=screen-256color

# START TMUX ON STARTUP
#====================
[[ $TERM != screen* ]] && exec tmux
However,...I would love to have both options combined.

That's my .tmux.conf:

Quote:

set-option -g default-command $SHELL

### BINDKEY - MAKE TMUX USE C-a, SIMILAR TO SCREEN
#====================

# unbind C-b
# unbind l
# set -g prefix C-a
# bind-key C-a last-window

# RELOAD KEY
#====================
# bind r source-file ~/.tmux.conf

### HISTROY LIMIT
#====================
set -g history-limit 10000

# THEME
#====================

# default statusbar colors
set-option -g status-bg colour0 #base02
set-option -g status-fg colour136 #yellow
set-option -g status-attr default

# default window title colors
set-window-option -g window-status-fg colour244 #base0
set-window-option -g window-status-bg default
#set-window-option -g window-status-attr dim

# active window title colors
set-window-option -g window-status-current-fg colour166 #orange
set-window-option -g window-status-current-bg default
#set-window-option -g window-status-current-attr bright

# pane border
set-option -g pane-border-fg colour235 #base02
set-option -g pane-active-border-fg colour240 #base01

# message text
set-option -g message-bg colour235 #base02
set-option -g message-fg colour166 #orange

# pane number display
set-option -g display-panes-active-colour colour33 #blue
set-option -g display-panes-colour colour166 #orange

# clock
set-window-option -g clock-mode-colour colour64 #green


# SET CORRECT TERM
#====================
set -g default-terminal screen-256color
My .screenrc:

Quote:

term screen-256color
I'd really appeciate if anyone could help me out, my head is spinning and the Advanced Bash-Scripting Guide of tldp.org I simply cannot digest right now.
Anyone?

Thanks in advance.
Jean-Luc

Jean-Luc Besson 02-05-2013 11:54 PM

OK,...solved.

I got rid of the export TERM=screen-256color in .bashrc and added the "-2" argument to tmux. It now works like a charm.


Quote:

# START TMUX ON STARTUP
#====================
[[ $- != *i* ]] && return
[[ $TERM != screen* ]] && exec tmux -2


All times are GMT -5. The time now is 08:30 AM.