2

Tmux was just updated to 3.0 on my system, and a few of the settings are broken now. set -g status-right " #P " used to display the pane number in the right hand corner. Now it does not work. I receive the error, .tmux.conf:6: usage: set-option [-aFgopqsuw] [-t target-pane] option [value] After the error all of the customizations to the status bar are not applied. If I start a session and then apply the customizations the error does not reproduce itself. How may I display the pane number with the current version of tmux?

Here's the rest of the lines in question. set-option -g status-position top is where the error occurs in the config file if set -g status-right " #P " is included.

set-option -g status-position top
set -g status-bg '#666666'
set -g status-fg '#aaaaaa'
set -g status-left-length 50
set -g status-right " #{pane_index} "

If I take all of the -g out everything breaks. The last line breaks with or without the -g.

I start tmux in my .zshrc.zsh file with:

getTerminalEmulatorName()
{
    echo $(basename "/"$(ps -f -p $(cat /proc/$(echo $$)/stat \
        | cut -d \  -f 4) | tail -1 | sed 's/^.* //'))
}

if _not_inside_tmux && [[ -z $(tmux display-message -p `#S`) ]]; then
    tmux new-session -y 32 -d -n Dropdown -s Command;
    tmux splitw -h -p 50 -t 0
fi
terminal=$( getTerminalEmulatorName )
if [[ $terminal == *"alacritty"* ]]; then
    tmux attach-session -t Command
fi
2
  • There is nothing wrong with the section of config you pasted, the problem is somewhere else in your config. Commented Dec 4, 2019 at 9:18
  • Ah, you are getting an error message. The standard answer to this is to take your config file and comment out say the second half, then try loading tmux. If you don't get the error message then you know the problem is in the second half, otherwise it is in the first half. Uncomment everything, and then comment out half of the half which is to blame. Repeat. 10 steps will handle even a thousand line config file, and 20 steps will handle a million line config file.
    – icarus
    Commented Dec 4, 2019 at 20:24

1 Answer 1

1

Remove the -g so the command is

set status-right " #P "

or

set status-right " #{pane_index} "
8
  • That still creates the same error. I'll go ahead and post the rest of the config interfering with setting proper settings.
    – ZeroPhase
    Commented Dec 4, 2019 at 2:01
  • I can't reproduce the problem with just those 4 lines after I remove the -g. Are you seeing any pane indicator at all? Perhaps setting the status-right to ">#P<" so the area is a bit more obvious? In the clutching at straws department, what is the underlying terminal? If you start a fresh instance of tmux with say tmux -f /dev/null -L testing and then use ctrl-b colon to enter the 4 config lines and a final ctrl-b colon to enter the modified 5th line, do you still have an issue?
    – icarus
    Commented Dec 4, 2019 at 5:51
  • 1
    This is wrong, you should have -g here. Commented Dec 4, 2019 at 9:16
  • @icarus The underlying terminal is alacritty. Doing what you suggested and manually entering the lines does not reproduce the issue. If I just have the above lines in the config file I still get the same error message.
    – ZeroPhase
    Commented Dec 4, 2019 at 20:02
  • Just to be clear, if you put the lines in a file, say /tmp/newtmux, and run tmux -f /tmp/newtmux -L testing2 so connecting to a new tmux server you do or do not get the error?
    – icarus
    Commented Dec 4, 2019 at 20:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .