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

Two squares on top of each bar in Tmux #577

Open
pcarrin2 opened this issue Jul 26, 2024 · 5 comments
Open

Two squares on top of each bar in Tmux #577

pcarrin2 opened this issue Jul 26, 2024 · 5 comments

Comments

@pcarrin2
Copy link

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 #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:

  1. Open tmux on a Linux tty
  2. Run cava
  3. See ugly double-squares on top of bars

Or:

  1. Set system locale to something non-utf8
  2. Run cava inside tmux
  3. 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

@pcarrin2
Copy link
Author

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!

@karlstav
Copy link
Owner

karlstav commented Aug 4, 2024

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".

@karlstav
Copy link
Owner

try setting this to 1:

cava/cava.c

Line 296 in 395b36e

int inAtty = 0;

if it works I can create a config option to force "tty mode"

@jamescraft10
Copy link

is there a way to just not render the bars on the top?

@karlstav
Copy link
Owner

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.

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

No branches or pull requests

3 participants