LazoCoder / Pokemon-Terminal

Pokemon terminal themes.
GNU General Public License v3.0
4.19k stars 224 forks source link

Fixed bug: Clearing when there's no current terminal background no longer results in KeyError. #211

Closed CullenLYe closed 2 months ago

CullenLYe commented 3 months ago

Currently, if the user tries to input "pokemon -c" when there is no current terminal background, a KeyError is caused. Screenshot 2024-04-03 111610

I added a simple try/except block to print out "There is no background to clear." to account for this. Screenshot 2024-04-03 111747

This also works for slideshow clearing too.

sylveon commented 2 months ago

Can we fix the bug in the Windows Terminal adapter here instead of wrapping the entire operation with a try-except? Probably by checking with if 'backgroundImage' in profile:

CullenLYe commented 2 months ago

Thank you so much for the feedback @sylveon ! Would this be acceptable?

sylveon commented 2 months ago

Yes, that's perfect! Thank you for the contribution :)

CullenLYe commented 2 months ago

Thank you @sylveon ! I appreciate the merge and the help. :)