Two squares on top of each bar in Tmux
Describe the bug
On my TTY, cava renders perfectly. However, in tmux, there are two boxes on top of each bar instead of a normal bar cap, like in https://github.com/karlstav/cava/issues/553. The workaround from that issue simply crashes cava.
If I set the (NixOS) system locale to en_US.iso8859-1 (slightly extended ASCII), then cava still runs fine on the tty but fails to run at all in tmux (blank screen). If I set the system locale to iso8859-1, run inside tmux, and locally change the locale to utf8 in cava's environment, it displays ASCII dashes instead of the box drawing glyphs that it does on a bare tty.
To Reproduce
Steps to reproduce the behavior:
- Open tmux on a Linux tty
- Run cava
- See ugly double-squares on top of bars
Or:
- Set system locale to something non-utf8
- Run cava inside tmux
- See that cava fails to display anything!
Expected behavior
Since other programs can draw boxes just fine inside tmux, I would expect cava to do the same thing, with box caps appearing properly.
Specs
cava built from source by NixOS. OS: NixOS Stable Environment: tmux over tty Hardware: thinkpad t14s For more configuration info, see https://github.com/pcarrin2/nixos
One fix would be to add a config option to disable the 1/8 and 7/8 bar tops, since I believe those are the only chars my terminal can't render!
hi @pcarrin2,
sorry about the late response.
I can confirm this.
In a tty all the block characters are usually not available, cava solves this by using a custom font where some of the characters are custom made. The issue is that when running tmux in a tty the terminal is no longer considered a tty, We would need to find some other way for cava to detect if it is in a tty. Or maybe a config option to force "tty mode".
try setting this to 1:
https://github.com/karlstav/cava/blob/395b36e75b2e8c2b35349e01f24719b61c42b10a/cava.c#L296
if it works I can create a config option to force "tty mode"
is there a way to just not render the bars on the top?
no, but this can most likely be solved by either adding a config option to force tty mode. Or finding a better way to detect if in a ttty.
Okay, this isn't a fix but another work around. I just found out about Zellij recently and it works pretty well for me. I just installed CAVA on my Linux phone to test and am getting no weirdness at the top, but obviously YMMV.