Closed anthonyjmartinez closed 2 years ago
Thank you! After a bit of tinkering, I think the issue is that sys.exit()
, when triggered by the mouse, doesn't stop the input being captured for some reason. If you call manager.stop()
and then call sys.exit()
it seems to work alright. Luckily there's already a method that does exactly that, so I'll update all the docs to reference manager.exit
instead of sys.exit
.
Could you elaborate on what happens in ptg
? I can't seem to reproduce this behaviour.
P.S. The version info is not in the current PIP package, but if you install from GitHub it's present. Thank you for the pip show
in its place!
@bczsalba - glad you were able to get to the bottom of it.
As for the ptg
behavior, when I exit the application my mouse clicks are still captured by the terminal and I have to ctrl-c and then type reset to make it stop. This appears to not happen in XTerm but does happen in GNOME Terminal. Perhaps I'll install a dozen or so terminals (kitty, alacrity, qterminal, ...) on one of my machines and see what happens.
Generally it pains me to take screenshots of text, but perhaps I can use asciinema to capture it in some way that's less abhorrent and can be copy-pasted from after the fact. I'll get something for you in the coming days for the sake of completeness.
Looking forward to getting to know this library better.
One question: how does one engage the exit button without the mouse?
Hm, that's very interesting! I've tested it on Kitty (my main terminal) and Alacritty some months ago, and I never had this specific issue.
What is supposed to happen (in a clean exit) is that all the mouse capturing is unset, the output thread is stopped and the program should not leave any traces behind. Out of curiosity, how do you exit the program? I'm pretty sure something more "forced" than CTRL_C
would cause that exact behaviour, as the program is forced to exit without having time to clean up. You're probably not using CTRL_\
, but it's worth a guess.
Once you do have some more information on this problem, could you please open a new issue? I think the purposes of this one have been exhausted.
How does one engage the exit button without the mouse?
This might be a little understated in all of the examples, but there is a pretty major system for keyboard selection. You should be able to scroll down using the arrow keys, CTRL_N
(up) & CTRL_P
(down), or j
and k
(in non-InputFields).
Thank you for your interest, and for helping me improve!
ptg
behavior is still present in GNOME Terminal.Indeed I'm just using a good ol' CTRL-C - no bigger hammers in use here.
Describe the bug When running the following documentation example, pressing the Exit button exits the window manager but not the application.
To Reproduce Steps to reproduce the behavior:
Expected behavior Press 'Exit', see application cleanly exit with a clean terminal state.
Screenshots
System information
pytermgui version shown
As requested
Additional note: ptg itself does the same thing on exit (re: leaving the terminal dirty)
Reproduces on my PureOS 10 (Debian based), Fedora 35, and Fedora Silverblue Rawhide systems using GNOME Terminal.
The hang behavior persists with XTerm, though the dirty state does not appear to.
Possible cause There appears to be a lock at play in the traceback. Maybe it isn't released?
Possible solution N/A