-1

I'm using Fish and byobu in Fedora with GNOME-Terminal. I didn't ask Fish to change the terminal title.

cat ~/.config/byobu/profile.tmux source $BYOBU_PREFIX/share/byobu/profiles/tmux set -g status-right '#(gitmux -cfg ~/.config/byobu/gitmux.conf) #{pane_current_path}' set-option -g status-interval 1 set-option -g set-titles on set-option -g set-titles-string '#{?#{==:#{host},localhost},#{host_short} -:,}#{pane_current_path}#{pane_current_path}' set allow-rename off set-option -g allow-rename off

When I cd some directory, it will briefly change the terminal title as expected before changing it to /home/psychoslave, whatever the actual path is. However as soon as I run a program, say yes, the title will go back to the right current path.

What might I tweak to always display the directory of the current Tmux pane in the terminal title?

psychoslave
  • 2,783
  • 3
  • 27
  • 44

1 Answers1

0

See https://github.com/fish-shell/fish-shell/issues/5699 for more information.

#!/bin/sh
:<<:about:
  Fix initial shell set up when opening a new a Tmux

  This is intended to be used in combination with a Tmux configuration such as:
  set-environment -g ENV $HOME/.config/byobu/enforce_user_shell.sh
  set -g default-shell /bin/sh
  set -g default-command $SHELL

  NOTE: Fit ENV set up above to match the current script.
:about:

# If Tmux did `set -g default-shell /bin/sh`
[[ $SHELL = '/bin/sh' ]] || exit

# POSIX test for “$TERM starts with 'screen'”, matching "screen-256color" too
case "$TERM" in screen*) true ;; *) false ;;  esac || exit

# Open a new tmux window, not impacted by the bug, at position 0 and exit
tmux move-window -s0 -t2 && tmux new-window -t0 && exit
psychoslave
  • 2,783
  • 3
  • 27
  • 44