jsbueno / terminedia

Python3 library for multimedia functions at the command terminal
GNU Lesser General Public License v3.0
100 stars 8 forks source link

`terminedia-plot` output garbled for almost every function except the default example #27

Closed vytas7 closed 2 years ago

vytas7 commented 3 years ago

terminedia-plot without any parameters works just fine, as in the demo screenshot.

However, trying to provide any other function results a semi garbled output with many fragments of escape characters:

$ terminedia-plot --func x

image

I've used the latest version this repo: pip install git+https://github.com/jsbueno/terminedia.

jsbueno commented 2 years ago

Sorry - I missed the notification for this. Could you add your O.S. and terminal program?

though the cause, it seems, is that it tries to plot above the first terminal line. It should be easily fixable. On the terminal program I am using right now, it just truncates the plot appropriately).

Ah, the explanation might even be on the garbage on your image: the negative line numbers are visible there. Probably some terminal programs just ignore negative lines, and the one you are using treat the ANSI positioning sequences as if they were no sequences at all.

vytas7 commented 2 years ago

Hi! It does seem to depend on the terminal program. I'm indeed not seeing this behaviour on Ubuntu 20.04 gnome-terminal, although I was seeing this on an older version.

jsbueno commented 2 years ago

I could not reproduce the problem on gnome terminal - maybe mine is newer, but it did show in certain conditions on KDE's terminal program, konsole.

It should be fixed - feel free to reopen if you still find this problem with current main.