Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tl doesn't exit gracefully (and hangs if called from inside another terminal UI) #59

Open
Roobxyz opened this issue Sep 30, 2024 · 2 comments

Comments

@Roobxyz
Copy link

Roobxyz commented Sep 30, 2024

OK bear with me here - I wanted to use this to view kubernetes pod logs, easy:

kubectl logs job-123 -f | tl

Except most of my time in kubernetes is spent using k9s
And k9s offers the ability to write custom plugins

So I thought, I'll bind Ctrl-L in k9s to kc log job-123 | tl and I'll have much better logging!

However due to the way tl handles quitting, k9s hangs whenever I Ctrl-C tl.
I then have to SIGKILL everything in order to get my terminal back...

It would be really cool if there was a way to more elegantly quit (which I suspect would fix this) or if the handling around SIGINT was a improved.

@Roobxyz
Copy link
Author

Roobxyz commented Sep 30, 2024

Attempted to close with Roobxyz:issue59

@Ins1nuatE
Copy link

I have the same problem, tl doesn't exit gracefully when using pipe, easily like:

ls | tl

Then I use Ctrl + C to quit tl, tl quitted but when I move my mouse, my terminal shows like this:

2024-10-23_15-15

I tried to fix it by using your code in the pull request, but it doesn't work for me.

However I find that if you use sys.exit(0) to exit tl instead of using sys.stderr.write("^C") with "TEXTUAL_ALLOW_SIGNALS": "1" in env, this env doesn't seem to be needed anymore? I remove this env and my problem solved.

I'm a beginner of English and Python, hope my expression is clear and my understandings is right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants