LazoCoder / Pokemon-Terminal

Pokemon terminal themes.
GNU General Public License v3.0
4.2k stars 225 forks source link

Ctrl + C interrupt event makes slideshow exit #197

Open noraworld opened 3 years ago

noraworld commented 3 years ago

Sometimes Ctrl + C interrupt event makes slideshow exit after slideshow starts.

$ pokemon -ss
Starting slideshow with 768 Pokemons and a delay of 10.0 minutes.
Forked process to background with PID 10785.
You can stop it with 'pokemon -c'.

# Type Ctrl + C on prompt due to the misstype command
$ misstype ^C
Process Process-1:

Traceback (most recent call last):
  File "/Users/noraworld/.anyenv/envs/pyenv/versions/3.8.5/lib/python3.8/multiprocessing/process.py", line 315, in _bootstrap
    self.run()
  File "/Users/noraworld/.anyenv/envs/pyenv/versions/3.8.5/lib/python3.8/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/noraworld/.anyenv/envs/pyenv/versions/3.8.5/lib/python3.8/site-packages/pokemonterminal/slideshow.py", line 29, in __slideshow_worker
    t.join(delay * 60)
  File "/Users/noraworld/.anyenv/envs/pyenv/versions/3.8.5/lib/python3.8/threading.py", line 1015, in join
    self._wait_for_tstate_lock(timeout=max(timeout, 0))
  File "/Users/noraworld/.anyenv/envs/pyenv/versions/3.8.5/lib/python3.8/threading.py", line 1027, in _wait_for_tstate_lock
    elif lock.acquire(block, timeout):
KeyboardInterrupt

This happens sometimes, not always. I have no idea when this happens.