Windows support
gabriel-vanca opened this issue · comments
Would love to see Windows support added to this, both for client and for server side.
It's in the backlog, but I'll make sure to bump it up since there seems to be some demand. What's the preferred shell for windows, powershell?
Powershell Core, yes. It's cross platform so could be used on the Linux machines too technically.
Powershell +1
Anyway @alajmo , Is it possible to replace os-spesific command with this library melbahja/goph
I'll look into it after I'm done with adding some needed unit and integrations tests (not sure how I'll test the remote window server, since I'm running Linux, but perhaps I could do it with Github actions or there's some lightweight virtualization software I could take advantage of).
Concerning goph, I've used some of their code already (their known_hosts logic mainly), but since SSH is central to sake
, I think it's better to use golangs std lib rather than a 3rd party lib. This could change in the future though
Sorry for my negligence, I was seen this function and I'm thinking, why is using user's ssh
command, why not using something embed/built-in
It's because it gets pretty complex when you use RequestPty on the remote hosts. You're left with manually handling all signals, and fixing key presses, for instance, Ctrl + L
doesn't clear the screen but prints out ^L
, key arrows don't work as you expect, and a lot more things.
So, it's easier to just delegate it to the users ssh
(which almost everyone has anyway, and you might even have some configs associated with your ssh in ~/.ssh/config
). One more note, we also use unix.Exec
to replace the current process, instead of creating a sub-process, where sake
commands normally run.
This is a good article https://dev.to/napicella/linux-terminals-tty-pty-and-shell-part-2-2cb2 to learn more about tty, pty and linux terminals.
Release v0.10.1 now supports
- overriding the current shell (with the default shell being PowerShell for windows), see sakecli.com/recipes. I haven't tested it thoroughly, so I'll keep this issue open until I've tested the functionality with a remote windows server
- running
sake
on windows (released Windows build)