Display your tmux window list directly in your terminal prompt, eliminating the tmux status bar.
Adds an additional powerline10k right prompt containing the window list from your tmux status
Note
Terminal prompts only update when you press enter, so you may see an out of date window list
Place this inside your ~/.p10k.zsh
function prompt_tmux() {
if [ -n "$TMUX" ]; then
local color=68
local output="$(tmux list-windows -F ' #I #W#{window_flags} ' | tr '\n' '|' | sed 's/|$//' | sed "s/|/%F{8}|%F{$color}/g" | awk '{$1=$1};1')"
local active_color=117
output="$(echo "$output" | sed -E "s/([0-9][^0-9]*)\*/%B%F{$active_color}&%b/g")"
if [[ "$output" == *"not ready"* ]]; then
return
fi
p10k segment -f $color -t "$output"
fi
}And in the same file add tmux to your existing POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS similar to below
typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(
# =========================[ Line #1 ]=========================
status # exit code of the last command
command_execution_time # duration of the last command
background_jobs # presence of background jobs
tmux # <- added thisOptional: Choose a different color below:
Optional: Place this in your ~/.tmux.conf if you'd like to hide your existing tmux status bar
set -g status off
