Gruvbox color-scheme not working in tmux-sessoin but working working in normal iterm2 - tmux

these values are in my tmux-session
I have tried changing these values.

>\# ColorScheme settings.
set -g default-terminal "xterm-256color".
set-option -ga terminal-overrides ",tmux-256color:Tc,xterm256color:Tc"
Adding these lines in the ./tmuxconfig worked.

Related

tmux status-line: italicize zoomed window name?

I've customized my tmux statusline, and I'd like to add a visual indicator for when the current window is zoomed (resize-pane -Z).
I've seen several examples of how to apply a different foreground color,
setw -g window-status-current-format " #{?window_zoomed_flag,#[fg=red],#[fg=black]}#W#[fg=default]"
Since I have italics working in tmux, I want to apply them in this case. I tried:
setw -g window-status-current-format " #{?window_zoomed_flag,#[fg=red,italics],#[fg=black]}#W#[fg=default]"
but this doesn't work. When zoomed it just shows empty spaces, and when unzoomed it shows italics],bash ("bash" being the window_name).
It seems to be treating the , in #[fg=red,italics] as one of the separators for the overall conditional form,
#{?test,alternative1,alternative2}
It does correctly handle a comma embedded in alternative2, e.g.
setw -g window-status-current-format " #{?window_zoomed_flag,#[fg=red],#[fg=black,italics]}#W#[fg=default]"
so if I wanted to italicize the unzoomed window name, I'd be in luck, but since I don't have a way to turn the conditional around, I am SOL.
Does anyone know a way to get this working, or is this an issue I should bring to the tmux project?
I got it working and now I'm not sure I actually like it, but it's good to know that it can be done. It's not entirely clear from the documentation, but I noticed in this answer this answer that you can specify the text attribute in a separate #[] group instead of using a comma-separated list, so this works:
setw -g window-status-current-format " #{?window_zoomed_flag,#[fg=red]#[italics],#[fg=black]}#W#[fg=default]"
probably a bit outdated answer yet helpful for anyone out there that might need help!
I have managed to do that with the following code :)
I will post the whole status bar in case anyone finds it any helpfull
set -g status-left '#[fg=black,bg=green] #S#{prefix_highlight}#[fg=green,bg=black,nobold,nounderscore,noitalics]#[fg=green,bg=green]#{?mouse,#[fg=black] MOUSE#[bg=green]#[fg=green],#[bg=red]#[fg=green]#[fg=white]#[bg=red]MOUSE#[bg=green]#[fg=red]}#{?pane_synchronized,#[fg=black] SYNC#[bg=green]#[fg=green],#[bg=red]#[fg=green]#[fg=white]#[bg=red]SYNC#[bg=green]#[fg=red]}#{?window_zoomed_flag,#[fg=black] #[bg=green]#[fg=green],#[bg=red]#[fg=green]#[fg=white]#[bg=red]#[bg=green]#[fg=red]}#[fg=green,bg=black] #W #[fg=green,bg=black,nobold,nounderscore,noitalics]#[fg=green,bg=black] #(whoami) CPU: #{cpu_percentage}Online:#{online_status}#[fg=green,bg=black,nobold,nounderscore,noitalics]'
set -g status-right '#[fg=green,bg=black,nobold,nounderscore,noitalics]#[fg=green,bg=black]#[fg=green,bg=black,nobold,nounderscore,noitalics]#[fg=white,bg=black]Bat: #{battery_percentage}#[fg=green,bg=black,nobold,nounderscore,noitalics]#[fg=black,bg=green]#(rainbarf --battery --remaining )'
setw -g window-status-format '#[fg=green,bg=black,nobold,nounderscore,noitalics]#[default] #I  #W #[fg=green,bg=black,nobold,nounderscore,noitalics]'
setw -g window-status-current-format '#[fg=green,bg=black,nobold,nounderscore,noitalics]#[fg=green,bg=black] #I  #W  #F #[fg=green,bg=black,nobold,nounderscore,noitalics]'

tmux configuration multiple variables

Getting errors for the last line. If for status right I only show either spotify or date it works. I cannot get it to show both. What am I missing?
tm_date="#[fg=$tm_color_inactive] %b %d - %I:%M"
tm_session_name="#[fg=$tm_color_feature,bold]$tm_icon #S"
set -g status-left $tm_session_name' '
set -g status-right '#(tmux-spotify-info)' '$tm_date
What is tmux-spotify-info? Is it similar to tm_spotify? If so, changing the line to this seems to fix it.
set -g status-right $tmux-spotify-info' '$tm_date

Prevent tmux from displaying/replacing user-namespace from window's name

I would like to give fix name different tmux pane title but whenever I move to a different directory tmux just replace pane name that I have define with something like: 0:username#namespace:~/directory which confusing. Any help?
I found the answer here
The tmux command for this is:
set-option -g allow-rename off

Renaming a window in tmux

I'm using bind-key + , to rename my windows, but as soon as I type a command the name reverts back to the current working directory.
Is it possible to make the window name permanent?
The automatic rename function is turned on. Add the following to your .tmux.conf file (and/or run from the command line to have it take effect immediately):
set-window-option -g automatic-rename off
Per this superuser answer, I made the following change to ~/.tmux.conf:
# NO, window name keeps changing
# set -g default-terminal "screen-256color"
# YES, window name sticks
set -g default-terminal "xterm-256color"

How can you tell which pane in Tmux is focused?

I'm starting to use tmux (I'm thinking of switching from screen), but I'm having a hard time telling which pane is focused when I split a window into multiple panes. Is there a config customization or something that can highlight the focused pane a little more explicitly?
Here are the relevant settings:
pane-active-border-style fg=colour,bg=colour
Set the pane border colour for the currently active pane.
So, try adding something like this to your ~/.tmux.conf:
set-option -g pane-active-border-style fg=blue
That will set a blue border around the active pane. The pane-active-border-style bg=colour option can be used for a more visible solution, as well.
As answered in another post it is now possible in tmux 2.1 to set the colours of individual panes. Ones can use:
set -g window-style 'fg=colour247,bg=colour236'
set -g window-active-style 'fg=colour250,bg=black'
in the ~/.tmux.conf file to show a difference between the active/inactive panes.
With Vim If you find it does not work with Vim panes, it might be down to the colourscheme you are using. First, try another colourscheme such as pablo. For further details, see the other post.
Customize status-left and use the #P character pair, which is the pane number. You will probably want to include more than just the pane number in the status bar, but here is an example of the line you would add to your ~/.tmux.conf for just the pane number:
set-option -g status-left '#P'
See the tmux man page for more character pairs: http://manpages.ubuntu.com/manpages/precise/en/man1/tmux.1.html
One Solution that works for me is to add a display-pane at the end of the hotkey for a pane switch. This displays all the pane numbers, with the current pane in a different color. You can also use <escape_key> + q to display pane numbers.
I use alt+h/j/k/l to switch between panes, and I use the following binding.
bind -n M-j select-pane -D \; display-pane
bind -n M-k select-pane -U \; display-pane
bind -n M-h select-pane -L \; display-pane
bind -n M-l select-pane -R \; display-pane
I wanted the active pane's borders to be brighter than other panes,
so I went with this (works in tmux 1.8 w/CentOS 7):
~/.tmux.conf fragment
# rgb hex codes from https://www.rapidtables.com/web/color/RGB_Color.html
set-option -g pane-active-border-fg '#33FF33' # brighter green
set-option -g pane-border-fg '#006600' # darker green
The tmux man page says hex-RGB colors will be approximated, and I find the hex codes easier to understand than remembering "colour47" (out of colour0-255) is a kind of light green (as described in How does the tmux color palette work?).
tmux man-page excerpt:
message-bg colour
Set status line message background colour, ...etc...
or a hexadecimal RGB string such as ‘#ffffff’, which chooses the closest
match from the default 256-colour set.
For tmux 3 I was able to set the following in my .tmux.conf for a subtle border indicator:
set-option -g pane-active-border-style bg=yellow

Resources