abishekvashok / cmatrix

Terminal based "The Matrix" like implementation
GNU General Public License v3.0
4.05k stars 421 forks source link

Fixes #98: Don't try to print non-printable chars #118

Closed abishekvashok closed 3 years ago

abishekvashok commented 3 years ago

This lead to unintended consequences as random block of characters appeared on resizing when we tried to pass non printable -1 to addch. Introduces a simple if statement to fix it.

Here's a gif:

StavromulaBeta commented 3 years ago

I'm still seeing a single line of block characters on the bottom row of my terminal emulator when I quickly shrink the window. However, it is certainly much better than before, where the blocks covered the entire terminal window in vertical lines. I'm using Xterm on Debian.

abishekvashok commented 3 years ago

I'm still seeing a single line of block characters on the bottom row of my terminal emulator when I quickly shrink the window. However, it is certainly much better than before, where the blocks covered the entire terminal window in vertical lines. I'm using Xterm on Debian.

Better isn't something we want, so I peered in deeper and found out that non-printable characters were being fed to ncurses, fixed it this time :) [the head on the other hand seemed to suppress it a bit]

I've updated the PR now @StavromulaBeta, can you make sure it works on your end?

abishekvashok commented 3 years ago

I don't like to self merge without reviews, but seems like it would take some time and it works on some machines I had access to. So doing it :D