mirror of
https://github.com/LazoCoder/Pokemon-Terminal
synced 2024-11-25 21:30:21 +00:00
Fixed bug: Clearing when there's no current terminal background no longer results in KeyError. (#211)
* Fixed bug: Clearing when there's no current terminal background no longer causes a KeyError. Currently, if the user tries to input "pokemon -c" when there is no current terminal background, a KeyError is caused. I added a simple try/except block to print out "There's no current background to clear." to account for this. * Checking 'backgroundImage' directly * Removed try/except block * Update windowsterminal.py Simplify check --------- Co-authored-by: Charles Milette <charles.milette@gmail.com>
This commit is contained in:
parent
ed8f7f4eba
commit
c7f8b9e97b
1 changed files with 2 additions and 2 deletions
|
@ -23,7 +23,7 @@ class WindowsTerminalProvider(_TProv):
|
|||
|
||||
# update defaults profile
|
||||
profile = profiles['defaults']
|
||||
if (path is None):
|
||||
if path is None and 'backgroundImage' in profile:
|
||||
del profile['backgroundImage']
|
||||
else:
|
||||
profile['backgroundImage'] = path
|
||||
|
@ -57,4 +57,4 @@ class WindowsTerminalProvider(_TProv):
|
|||
WindowsTerminalProvider.set_background_image(None)
|
||||
|
||||
def __str__():
|
||||
return "Windows Terminal"
|
||||
return "Windows Terminal"
|
||||
|
|
Loading…
Reference in a new issue