Open thiswillbeyourgithub opened 2 weeks ago
Thanks for the report.
Hopefully all we need to do here is just warn or fallback to xterm if we can't resolve terminfo.
@thiswillbeyourgithub, I wasn't able to repro, but I wrote a blind patch that should hopefully work (#62). If you're up for it, I would appreciate it if you could try building that branch and seeing if it fixes the problem.
After cloning the repo and checking out the branch, you can test out shpool by doing
cargo run -- -s /tmp/shpool.sock daemon
then
cargo run -- -s /tmp/shpool.sock attach testsession
in order to attach. This way you won't disturb any existing shpool daemon you have running.
Thanks a lot! I'll check in a couple of days max
Well actually I tested now and it seems to join fine BUT to my great surprise inside the shpool session the arrow keys and backspace are completely broken, they seam to repeat some strings instead of doing their original function.
Nothing in my .zshrc has anything to do with that AFAIK
We fall back to xterm
terminfo if we can't find the terminfo based off of $TERM
, so maybe kitty uses different control codes from xterm for arrow keys? That seems pretty weird though, I would imagine those are pretty standard. Also, shpool doesn't do anything with regard to arrow keys, just passed them through like everything else. We use the termini create for terminfo, so maybe if you can set things up so that it can find your terminfo file things will be different. I notice you have $TERMINFO pointing to some local file. One thing to try would be to put TERMINFO
in forward_env since that might not be getting forwarded to the shpool session (if that works for you we should probably add it to the default set).
It might be worth capturing your shell output with and without shpool in the loop and then comparing the bytes to see if there is a difference in the control codes coming back to kitty.
I can also try installing kitty rather than just messing with TERM in tests to repro. That may take a bit though since my normal computer is having some trouble.
Unfortunately I know very little about how terminals work so it might be the best way forward :/ I'm very interested in shpool (as tmux can't work with kitty) but am holding off until the dust settles and the kitty issues are more well known.
I recommend giving kitty a try! Especially the timecoded video the author made to showcase features: https://sw.kovidgoyal.net/kitty/
Update: I noticed today that when I do "sudo su" in a terminal, my session seems to have the same issue: pressing backspace seemed to be the spacebar and the arrow keys were funky. None of this is related to shpool, I'm talking about a kitty issue.
So I found this kitty issue where the dev suggests adding this to visudo: Defaults env_keep += "TERMINFO"
and it solved this kitty issue.
So I tried again your patch and it seems to work fine now.
AFAIC you can merge it.
edit: had linked the wrong issue!
What happened I can't create shpool sessions in kitty-terminal but I can with gnome-terminal. Here's the output that appears in journalctl -f:
Here are relevant outputs in my kitty:
And on gnome-terminal:
So I tried this in kitty:
TERM="xterm-256color" shpool attach -f "test"
and it worked directly.What I expected to happen First, this error should appear not only in journalctl but to the user that called it! I get no feedback that shpool failed except that
shpool list
shows an empty list. Then, the error is incorrect: it should not be "Terminfo" file not found (the file is found) but has to do with $TERM.To Reproduce Steps to reproduce the behavior:
TERM="xterm-kitty" shpool attach -f "test"
Version info shpool 0.6.2
Logs