Tmux: How to configure tmux to display the current working directory of a pane on the status bar?

后端 未结 3 2077
伪装坚强ぢ
伪装坚强ぢ 2021-02-04 03:14

I am new to tmux and I am trying to edit my tmux.conf file to have the left side of the status bar reflect:

[SessionName] [CurrentPane] [CurrentWorkingDirectory]

3条回答
  •  梦毁少年i
    2021-02-04 03:42

    I'm not sure how to do this in bash, but in zsh, there's a hook that gets run before every command. In your .zshrc:

    precmd () {
        tmux set -qg status-left "#S #P $(pwd)"
    }
    

    This will run that tmux command everytime you run a command. Hope this helps. Since bash doesn't have a precmd, I'm not sure how to do this.

提交回复
热议问题