ceccopierangiolieugenio / pyTermTk

Python Terminal Toolkit - a Spiced Up TUI Library 🌶️
https://ceccopierangiolieugenio.github.io/pyTermTk/
MIT License
585 stars 22 forks source link

Pressing Ctrl-Z while script is running causes exception #27

Closed jeffwright13 closed 2 years ago

jeffwright13 commented 2 years ago

An AttributeError occurs when I press Ctrl-Z in any of the scripts I run. line 112 of term.py isattempting to access a non-existing echo attribute in the TTkTerm class.

For example, while running pyTermTk/demo/showcase/windows.py:

$ python windows.py
Traceback (most recent call last):
  File "/Users/jwr003/coding/pyTermTk/demo/showcase/windows.py", line 57, in <module>
    main()
  File "/Users/jwr003/coding/pyTermTk/demo/showcase/windows.py", line 54, in main
    root.mainloop()
  File "/Users/jwr003/coding/pyTermTk/venv/lib/python3.10/site-packages/TermTk/TTkCore/ttk.py", line 115, in mainloop
    evt = self.events.get()
  File "/Users/jwr003/.pyenv/versions/3.10.2/lib/python3.10/queue.py", line 171, in get
    self.not_empty.wait()
  File "/Users/jwr003/.pyenv/versions/3.10.2/lib/python3.10/threading.py", line 320, in wait
    waiter.acquire()
  File "/Users/jwr003/coding/pyTermTk/venv/lib/python3.10/site-packages/TermTk/TTkCore/ttk.py", line 208, in _SIGSTOP
    TTkTerm.stop()
  File "/Users/jwr003/coding/pyTermTk/venv/lib/python3.10/site-packages/TermTk/TTkCore/TTkTerm/term.py", line 112, in stop
    TTkTerm.echo(True)
AttributeError: type object 'TTkTerm' has no attribute 'echo'
ceccopierangiolieugenio commented 2 years ago

This could be related to the olf library installed with pip as happened in #25 I recently fixed this echo error Still there are issue when resuming from "bg" (I don't repaint the buffer)

jeffwright13 commented 2 years ago

This one is still happening, even with the latest code. I just pulled latest:

$ git lol
* 1ac43e7 - (HEAD -> main, origin/main, origin/HEAD) My personal OCD (72 minutes ago) <Eugenio Parodi>
* a12f3a9 - TTkString basic ANSI support, added TTkTextEdit append (76 minutes ago) <Eugenio Parodi>
* d8a3722 - (tag: 0.9.0a) Improved Drag'n Drop Pixmap, Added D&D demo, Basic HUE Manipulation in TTkImage, D&D Bugfix (3 days ago) <Eugenio Parodi>
* c656daa - Drag and Drop Bugfix 2 (3 days ago) <Eugenio Parodi>
* f1335af - Drag and Drop Bugfix (3 days ago) <Eugenio Parodi>