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

On some legacy Macs, CPUs are not shown in the basic mode #397

Closed
097115 opened this issue Jan 22, 2021 · 2 comments · Fixed by #398
Closed

On some legacy Macs, CPUs are not shown in the basic mode #397

097115 opened this issue Jan 22, 2021 · 2 comments · Fixed by #398
Assignees
Labels
bug Something isn't working the way that is expected.

Comments

@097115
Copy link

097115 commented Jan 22, 2021

Describe the bug

I have this oldie MacBook, running 10.11, and in basic mode CPUs aren't shown.

To reproduce

Steps on how to reproduce the behaviour:

btm -b:

vs btm:

bottom version

bottom 0.5.6

bottom config file (if used)

None.

Installation method

A binary from Releases.

Platform and environment information

Operating system, OS version, and architecture

macOS 10.11

Terminal (i.e. urxvt, kitty, etc.)

Terminal.app, Alacritty, iTerm

Shell (i.e. zsh, bash, etc.)

bash

Miscellaneous system info

RAM size: 8GB

SWAP size: 1GB

CPU and number of cores: 2.4 GHz Intel "Core 2 Duo" processor (P8600), with two independent processor "cores" on a single silicon chip, a 3 MB shared "on chip" level 2 cache

@097115 097115 added the bug Something isn't working the way that is expected. label Jan 22, 2021
@ClementTsang
Copy link
Owner

Hm, that's weird - it's probably a bug in how I display CPU cores in basic mode, which shouldn't be too hard to fix.

I'll try to replicate it in another low-core environment when I have some time and get back to you with a fix if possible.

@ClementTsang ClementTsang self-assigned this Jan 22, 2021
@ClementTsang
Copy link
Owner

Can replicate on Ubuntu with 2 cores. Investigating...

ClementTsang added a commit that referenced this issue Jan 25, 2021
…eported (#398)

So it seems that tui-rs doesn't like rendering my CPU bars if the height is exactly 1. It needs at least 2. I have no idea why, this is probably something weird with how I render.

This, of course, breaks when there is only one row to report (i.e. with a dual core setup in #397).

The workaround switches the gap between the CPU and mem/net parts to 0, and increases the CPU's draw height by 1, only when the height is otherwise 1 (so the draw height is now at least 2). This does have the side effect of including an extra line to the side borders, but I think it's fine.
ClementTsang added a commit that referenced this issue Jan 31, 2021
…eported (#398)

So it seems that tui-rs doesn't like rendering my CPU bars if the height is exactly 1. It needs at least 2. I have no idea why, this is probably something weird with how I render.

This, of course, breaks when there is only one row to report (i.e. with a dual core setup in #397).

The workaround switches the gap between the CPU and mem/net parts to 0, and increases the CPU's draw height by 1, only when the height is otherwise 1 (so the draw height is now at least 2). This does have the side effect of including an extra line to the side borders, but I think it's fine.

(cherry picked from commit d48e6cd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working the way that is expected.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants