3

I want to use the powerline extension in tmux and vim. In vim it works pretty good, shows all segments and also the powerline-gitstatus (used to show more git infos than the common.vcs.branch segment), but in the tmux statusbar, it is not possible to show the segments on the left side as configured in the .config/powerline/themes/tmux/default.json theme. My theme:

{
  "segments": {
    "left": [
      {
        "function":  "powerline.segments.common.env.cwd"
      },
      {
        "function": "powerline_gitstatus.gitstatus",
        "priority": 40
      },
      {
        "function": "powerline.segments.common.vcs.branch"
      }
    ],
    "right": [
      {
        "function": "powerline.segments.common.net.network_load"
      },
      {
        "function": "powerline.segments.common.sys.uptime",
        "priority": 50,
        "before": "UP: "
      },
      {
        "function": "powerlinemem.mem_usage.mem_usage_percent",
        "priority": 50,
        "args": {
          "format": "Mem: %d%%"
        }
      },
      {
        "function": "powerline.segments.common.sys.cpu_load_percent",
        "priority": 50,
        "before": "CPU: "
      },
      {
        "function": "powerline.segments.common.net.external_ip"
      }
    ]
  }
}

And the output of powerline tmux left (symbols displayed correctly):

#[fg=colour250,bg=colour240,nobold,noitalics,nounderscore] ~ 
#[fg=colour245,bg=colour240,nobold,noitalics,nounderscore] 
#[fg=colour250,bg=colour240,nobold,noitalics,nounderscore]Documents 
#[fg=colour245,bg=colour240,nobold,noitalics,nounderscore] 
#[fg=colour252,bg=colour240,bold,noitalics,nounderscore]gitTest 
#[fg=colour240,bg=colour236,nobold,noitalics,nounderscore] 
#[fg=colour247,bg=colour236,nobold,noitalics,nounderscore] No commits yet on master
#[fg=colour214,bg=colour236,nobold,noitalics,nounderscore] … 2 
#[fg=colour247,bg=colour236,nobold,noitalics,nounderscore] 
#[fg=colour250,bg=colour236,nobold,noitalics,nounderscore] master
#[fg=colour236,bg=default,nobold,noitalics,nounderscore]

Here is whats is displayed in the power/statusline: screenshot of powerline statusline

So as you can see, the left side is configured for the segments: current working directory, gitstatus and branch. And the problem is that although it seems that the output of powerline tmux left is correct, it is not correctly displayed. The right side of the statusbar works fine.

Has anyone ever already solved this issue? Any ideas about how to fix it?

Inputs appreciated.

christoph
  • 628
  • 7
  • 18
avermaet
  • 1,543
  • 12
  • 33

1 Answers1

0

You have to set a higher value for status-left-length. I can clearly see that the cwd segment has been cut. The default 20 characters as far as I know.

Setting set -g status-left-length 20 in ~/.tmux.conf looks in your case like

enter image description here

If you set it to an higher value

If you set it to a more reasonable value like 150 you get what you need:

enter image description here

But be careful. A chosen value on the left or right side will overlap each other and remove elements. Or will not be shown as in your example.

I am currently happy with using

set -g status-left-length 150
set -g status-right-length 180

This depends on your screen or windows size.

Also, IMHO all your dynamic segments (in size) should stay on the right side and only static segments should be shown left to have a more clear view on the open tabs. But that's just an opinion.

christoph
  • 628
  • 7
  • 18