chris-marsh / pureline

A Pure Bash Powerline PS1 Command Prompt
MIT License
507 stars 95 forks source link

Allowing TMUX pane titles to persist #66

Closed akd5027 closed 2 years ago

akd5027 commented 3 years ago

When running within tmux, attempt the following at the prompt

```bash
> tmux set -g pane-border-status bottom
> tmux set -g allow-rename off
> tmux set -g pane-border-format "< #T >"
> tmux split-window

> tmux select-pane -T "New Title"
```    

Prior to this change, the pureline_pre function is constantly setting the gui window title. This is the same value that TMUX uses to determine the pane title. This 'resetting' of the xterm title overwrites the tmux pane title. For this reason, and only within properly branded TMUX sessions, we do not reset the window title.

akd5027 commented 3 years ago

Prior to this change, you would need to run a tight loop to even see the title changing:

while tmux select-pane -T "Testing"; do :; done
CyrilOtheninGirard commented 2 years ago

If https://github.com/chris-marsh/pureline/pull/82 is merged, then you will have a simple way to prevent pureline from updating the GUI window title when using TMUX.

Just add this line to your pureline configuration file :

# If using tmux, allow pane titles to persist
[ -n "$TMUX" ] && unset PL_TITLEBAR
CyrilOtheninGirard commented 2 years ago

(sorry for the mess, it's my first time with GIT, and thus with github and pull requests)