powerline / powerline

Powerline is a statusline plugin for vim, and provides statuslines and prompts for several other applications, including zsh, bash, tmux, IPython, Awesome and Qtile.

Home Page:https://powerline.readthedocs.org/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Some segments not showing up in tmux after version upgrade

Laevos opened this issue · comments

After doing a system upgrade and upgrading to Powerline 2.8.2-4 on Python 3.10.1, running Arch Linux 5.15.10-arch1-1, it appears that tmux segments which make use of ThreadedSegment no longer appear. Namely, I'm missing the following:

  1. powerline.segments.common.sys.{uptime,system_load} (Note that uptime doesn't use ThreadedSegment, so the problem might be elsewhere)
  2. A segment I wrote which was working fine under the previous Powerline version I had installed under Python 3.9, which makes use of ThreadedSegment

This is my tmux config file:

	"segments": {
		"right": [
			{
				"function": "powerline.segments.common.sys.uptime",
				"priority": 50
			},
			{
				"function": "powerline.segments.common.sys.system_load",
				"priority": 50
			},
			{
				"function": "powerline.segments.aqi.aqi"
			},
			{
				"function": "powerline.segments.common.time.date"
			},
			{
				"function": "powerline.segments.common.time.date",
				"name": "time",
				"args": {
					"format": "%H:%M",
					"istime": true
				}
			},
			{
				"function": "powerline.segments.common.net.hostname"
			}
		]
	}
}

And the relevant section of my statusline minus hostname:
image

Did you try a clean reinstall? Maybe it's not the tmux upgrade, but some Python stuff that broke, as Arch Linux recently got 3.10 added.

Anyway, can you provide the output of the powerline-render tmux right command? (Note: powerline-render might differ in your environment, depending on whether you use the daemon or not)

rline-render` does seem to shed some light on the problem, thanks!

powerline-render tmux right           
2021-12-23 12:59:53,146:ERROR:tmux:aqi:Failed to set highlight group: 'Highlighting groups not found in colorscheme: system_load_gradient'
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/powerline/segment.py", line 148, in set_segment_highlighting
    segment['highlight'] = colorscheme.get_highlighting(
  File "/usr/lib/python3.10/site-packages/powerline/colorscheme.py", line 105, in get_highlighting
    raise KeyError('Highlighting groups not found in colorscheme: ' + ', '.join(groups))
KeyError: 'Highlighting groups not found in colorscheme: system_load_gradient'

In my code, the use of system_load_gradient looks like this:

ret = [{
  'highlight_groups': ['system_load_gradient'],
}]      

Compare the usage in segments.common.sys:

ret.append({
[...]
  'highlight_groups': ['system_load_gradient', 'system_load'],
[...]
})

It appears that system_load_gradient is not a valid gradient choice in the tmux solarized colorscheme, only system_load, as when I add system_load to my highlight_groups, I no longer get an error.

I was able to fix this and the visual styling by changing the tmux colorscheme in config_files/config.json from solarized to default. Thanks so much for your help!