Does anyone know how to hide this separator in byobu/tmux+powerline?
I found the solution. In tmux it is a window option called a window-status-separator. You can set it in the .tmux.config by adding it after the powerline is initialized:
set-window-option -g window-status-separator ""
It overwrites the default separator (" "). Luckily, it does not affect any styling of powerline. Maybe someone knows a powerline specific answer. Feel free to comment.
Related
Is there way to set terminator (Version: 0.95ppa1) title of tabs to a different string via bash command-line (CLI)?
I plan to use this feature with AutoKey and I can open multiple machines at same time and set title to Name of the machine its connected to.
ORIG=$PS1
TITLE="\e]2;\"This is just crazy enough to work\"\a"
PS1=${ORIG}${TITLE}
Resets title to
"This is just crazy enough to work"
This should apply to all xterm-style terminal emulators.
From the Terminator man pages,
Ctrl+Alt+W
Rename window title.
Ctrl+Alt+A
Rename tab title.
Ctrl+Alt+X
Rename terminal title.
You can also launch a new instance with
$ terminator --title [title]
Add follwing in your .bashrc file by editing it using vim ~/.bashrc and use set_title to rename your tab:
set_title()
{
ORIG=$PS1
TITLE="\e]2;$*\a"
PS1=${ORIG}${TITLE}
}
run source ~/.bashrc command after editing your .bashrc file
Ex.: set_title newtab will rename your current tab to newtab
working Properly in Gnome3.14 terminal and terminator 0.97
On Terminator 1.91-6 double click terminal title enables edition
PS1 does not need to be set. Credit for this function goes to geirha on freenode #bash
set_title() { printf '\e]2;%s\a' "$*"; }
This seems to work for me. I'm using BASH on Crunchbang (Debian derived)
$ echo -en '\e]0;echo works too\a'
With Terminator 0.96 and GNU bash 4.2.25 the printf suggestion above worked for me, but I had to tweak it slightly to make it into a function that would just work for me in a new Terminator tab. I added this to the end of my ~/.bashrc file:
set_title() { printf "\e]2;$*\a"; }
The key was placing the \a at the end of the quoted string. Then when opening a new tab in Terminator I can use this like so:
set_title "My new tab title"
Apologies to those who already stated the essentials of this answer, but since I found that I had to make slight changes to get it to work for me, this my also benefit someone else.
Try add PROMPT_COMMAND='echo -en "\033]0; $("pwd") \a"' in your .bashrc
For terminator 0.98 (Ubuntu 16.04 MATE), right clicking the title enables renaming it.
Right click on terminator and choose preferences from the drop-down menu. Choose profiles tab and enable "show title bar" option. It works!!
Tip: You can actually rename each terminator window!!
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]'
I just made the switch to Zsh, but I'm facing a weird problem with it: every time I hit the tab key, the prompt goes up a line, thus eating what was above.
In order to demonstrate the problem more clearly, I created a GIF:
I'm using a custom theme and Oh My Zsh. You can find the theme here: http://pastebin.com/12dZtZf3.
EDIT: The problem seems to reside in my theme, as using other themes solves the problem.
EDIT: The culprit seems to be in the function that prints the row of dashes and the date above the prompt:
_professional_prompt_header() {
echo -n "$bg[grey]"
for i in {0..$(( $(tput cols) / 2 - 6 ))}; do
echo -n "--"
done
# Uncommenting this line fixes the problem.
# Tried echo without -n and print, but no success.
echo -n " %*$reset_color"
}
This has also emerged as an issue with multiline prompts in the release of zsh 5.3. As of 2017-01-13, a patch has not been released. A discussion and explanation can be found in this prezto issue.
More discussion of the offending zsh issue itself can be found here.
Hopefully a fix will emerge from the zsh project. If not, some workarounds mentioned on that github repo are to make your PROMPT variable only a single line, outputting any other lines in the precmd function. This seems like a pain, however, so until it is fixed (or decided to be a "feature"), the easiest fix sounds like it is to roll back to zsh 5.2.
I posted an issue found at on the github link below, but in short, I can't get zsh to work properly. I'm open to suggestions.
https://github.com/erikw/tmux-powerline/issues/125
Do you have UTF characters in your prompt? If so, make sure you have these settings in your .tmux.conf:
# use UTF8
set -g utf8
set-window-option -g utf8 on
Some UTF characters will take an extra space, causing some weird formatting of tmux-powerline.
When I press the prefix-key Ctrl-b tmux doesn't give me a hint that it has been pressed.
Sometimes I can not remember whether I have already pressed it or not.
Can I set up a hint like highlight/change color or show some special symbol in the status bar to show me when I have pressed the prefix-key?
The development version of tmux has support for this, so the next release (1.8?) should also support it.
There have been two changes that can be combined to indicate in your status line whether a prefix key has been pressed:
You can include the extended “format” replacements in the values of the “status” options. These replacements were first available in tmux 1.6, but they were not previously usable in the status options.
The client_prefix format replacement was added.
You could add a (conditional) highlighted <Prefix> string before the default status-right like this:
set -g status-right ' #{?client_prefix,#[reverse]<Prefix>#[noreverse] ,}"#{=21:pane_title}" %H:%M %d-%b-%y'
There's also a Tmux plugin called tmux-prefix-highlight that does this.
It adds a new keyword, #{prefix_highlight} to use in the string that defines your tmux status bar, like so:
set -g status-right '#{prefix_highlight} | %a %Y-%m-%d %H:%M'
I created plugin for this. It indicates copy mode as well, is easily customizable and has good out-of-the-box experience.
https://github.com/dominikduda/tmux_mode_indicator
As readme says:
Plugin indicating normal/insert/prefix/copy modes.
It adds a new keyword, #{tmux_mode_indicator} to use in the string that defines your tmux status bar. Like this:
set -g status-right "#{tmux_mode_indicator}"