Coder Social home page Coder Social logo

Comments (5)

anko avatar anko commented on May 11, 2024

I'd also guess a font issue.

cava ships with a font cava.psf which it sets on the TTY to ensure it can draw bar characters. That doesn't apply to terminal emulators.

What terminal emulator are you using? What fonts have you tried?


Latest commit 9712160 on master works as expected for me, on st, evilvte and rxvt-unicode and gnome-terminal with a few monospace fonts I tried.

from cava.

karlstav avatar karlstav commented on May 11, 2024

If this is what you are seein in terminal emulator, then the problem is that cava thinks it is in the tty.

As anko said cava uses its own font in tty, cava uses the return value from trying to set the font in order to determine wether it is in tty or not:

'virt = system("setfont cava.psf >/dev/null 2>&1");'

This returns 0 in tty and some other value in virtual terminal, but maybe there are some better way of ensuring whether running in tty or virtual terminal.

from cava.

ajouellette avatar ajouellette commented on May 11, 2024

I just tried Droid Sans Mono, Fira Mono, DejaVu Sans Mono, and Liberation Sans Mono in urxvt, problem is still present. Also, cava used to work for me, I don't know exactly when the bars changed to numbers, but it seems to be a more recent issue.

from cava.

anko avatar anko commented on May 11, 2024

@karlstav Perhaps we should use ttyname.

Quick test—

#include <unistd.h>
#include <stdio.h>

int main() {
    printf("%s\n", ttyname(0)); // Check where stdin is coming from
}

—returns /dev/pts/19 in a terminal emulator and /dev/tty2 in TTY 2.

I'll test a little more and send a patch.

@aouelete If you run setfont ; echo $? in your terminal, what do you get? (This attempts to set the TTY font to default, then prints the command's exit code.) I get 0 in a TTY and 1 in a terminal emulator. Currently cava relies on that.

from cava.

ajouellette avatar ajouellette commented on May 11, 2024

For some reason, I get an exit code of 0 in urxvt, xterm, xfce-terminal, and termite. Hopefully your solution fixes this.

from cava.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.