Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some segments not showing in tmux on macOS #2191

Open
kadaliao opened this issue Jan 2, 2022 · 4 comments
Open

some segments not showing in tmux on macOS #2191

kadaliao opened this issue Jan 2, 2022 · 4 comments

Comments

@kadaliao
Copy link

kadaliao commented Jan 2, 2022

Hi there,

I just set up a new mac book and some of the segments are not showing in tmux.

my configuration: ~/.config/powerline/themes/tmux/default.json

{
  "segments": {
    "right": [
      {
        "function": "powerline.segments.common.sys.cpu_load_percent",
        "priority": 30,
        "threshold": 5,
        "before": "CPU: "
      },
      {
        "function": "powerline.segments.common.env.virtualenv",
        "priority": 20
      },
      {
        "function": "powerlinemem.mem_usage.mem_usage_percent",
        "priority": 50,
        "args": {
          "format": "Mem: %d%%"
        }
      },
      {
        "function": "powerline.segments.common.net.network_load"
      },
      {
        "function": "powerline.segments.common.time.date"
      },
      {
        "function": "powerline.segments.common.time.date",
        "name": "time",
        "args": {
          "format": "%H:%M",
          "istime": true
        }
      }
    ]
  }
}

But network_load, virtualenv, cpu_load_percent is not showing.

image

image

image

The same configuration works fine on other macOS computers.

Any idea why this is happening?

@PH111P
Copy link
Member

PH111P commented Jan 2, 2022

Hi @kadaliao, thanks for your detailed report.

Some segments require extra python libraries. In particular, the segments you mentioned require:

  • network_load: psutil or the presence of /sys/class/net/{interface}/statistics/{rx,tx}_bytes
  • cpu_load_percent: again psutil
  • virtualenv: This one should be fine as is, it reads the environment variable VIRTUAL_ENV though, which could get set incorrectly

Having said that, psutil seems to be installed on your machine (otherwise the segments wouldn't work in the python console either). I could imagine that the tmux renderer has some problems with the threaded segments (the load segments)—Are you using the same powerline version on your machine as the confirmed working installations?
Also, I am not familiar with the mem_usage segment; it might be doing something weird.

@kadaliao
Copy link
Author

kadaliao commented Jan 2, 2022

@PH111P thanks for the reply.

I'm using powerline version 2.7. (all is installed by pip install pwoerline-status)

the virtualenv segment is not showing even the VIRTUAL_ENV variable is set and generated by powerline tmux right

image

@PH111P
Copy link
Member

PH111P commented Jan 3, 2022

Very strange. Just to make sure, that segment is not cut off due to a lack of horizontal space, right? My next suspicion would be that the tmux line never "sees" the updated environment variable and hence never shows the corresponding segment. (This used to be a problem for the cwd segment until it got fixed in #2127, so perhaps a similar fix is needed here as well)

@kadaliao
Copy link
Author

kadaliao commented Jan 4, 2022

@PH111P nope, i made the window small just for ease of screenshot. Good news is that cpu_load_percent and network_load work fine now after I updated macOS to Monterey 12.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants