gigalixir / gigalixir-cli

MIT License
52 stars 45 forks source link

Support for kitty terminal #52

Closed Anderssorby closed 4 years ago

Anderssorby commented 4 years ago

When I run gigalixir ps:remote_console in kitty I get the warning tput: unknown terminal "xterm-kitty". And the resulting console does not support navigating the input or moving through history.

For ssh this is usually resolved by using kitty +kitten ssh

Could you fix it?

jesseshieh commented 4 years ago

I'm not all that familiar with kitty, but I think I still need a little more information. Are you running kitty on your local development machine or on your gigalixir replica/container? Where would the command kitty +kitten ssh be run? If it helps, you can see all that ps:remote_console is doing here https://github.com/gigalixir/gigalixir-cli/blob/master/gigalixir/app.py#L224. Also, I'm guessing I probably can't just drop a kitty-specific command somewhere. It needs to either be an option or hook or something for kitty users to use.

Anderssorby commented 4 years ago

I don't know this very well, but kitty +kitten ssh is sort of a wrapper that ensures proper headers and meta information is added. It think it is sufficient to add a check if $TERM == "xterm-kitty" and then use kitty +kitten ssh instead of ssh.

jesseshieh commented 4 years ago

Gotcha, I don't think we can put in any kitty specific branches, but what we might be able to do is allow you to specify a "custom ssh command" so you do something like gigalixir ps:ssh --ssh_command="kitty +kitten ssh". I'm not sure if this will be a very high priority for us since this is the first report I've gotten about this sort of issue, but if a lot of people upvote or comment on this issue, then we'll certainly bump up the priority. That said, we're happy to merge pull requests if someone wants to implement this. It shouldn't be too involved. The relevant code is here https://github.com/gigalixir/gigalixir-cli/blob/master/gigalixir/__init__.py#L358

We already provide an ssh_opts option which is very similar, but not exactly the same. I wonder if it's possible to make use of that instead for this specific case.

Anderssorby commented 4 years ago

Sounds like a nice fix. I'll make a PR when I get time for it :+1: