-
Notifications
You must be signed in to change notification settings - Fork 618
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
Changing the VM user's shell to fish causes lima to wait forever for the SSH requirement to be satisfied #2856
Comments
Is this a regression in v1.0? |
It seems like // ssh.ExecuteScript will strip the `#!` prefix from the first line and invoke the rest
// of the line as the command. The full script is then passed via STDIN. We use the $' '
// form of shell quoting to be able to use \n as newline escapes to fit everything on a
// single line:
//
// #!/bin/bash -c $'while … done<<EOF\n$(sudo …)\nEOF\n/usr/bin/env ruby'
// #!/usr/bin/env ruby $ fish
Welcome to fish, the friendly interactive shell
Type `help` for instructions on how to use fish
anders@ubuntu ~> /bin/bash -c $'while … done<<EOF\n$(sudo …)\nEOF\n/usr/bin/env ruby'
fish: Expected a variable name after this $.
/bin/bash -c $'while … done<<EOF\n$(sudo …)\nEOF\n/usr/bin/env ruby' commit 2fd8ad7 |
https://fishshell.com/docs/current/design.html#the-law-of-orthogonality
One workaround would be to With all the annoyance of having to |
Looks like it. According to what @afbjorklund found, this was changed in #2570. There are 20 lines of comments on why the code is this way. I guess writing to a temp file is an option, but where would we put it, in |
I just used mktemp, which uses $TMPDIR (that should default to /tmp on most...) like in 27603c1 for the guest-install You can probably do it without three separate calls to |
Is Should you fall back to |
I don't think there are any absolute guarantees. Could it be quoted in some other way? The fish workarounds reminds me of the horrible things you had to do for |
According to the fish manual, you are supposed to just drop the quotes. https://fishshell.com/docs/current/fish_for_bash_users.html#quoting But that would require some kind of lima config, to change the syntax. EDIT: And of course it didn't work either.
So it probably needs to take the long route. |
Maybe it (the support for param.env) could be added to sshocker https://github.com/lima-vm/sshocker/blob/master/pkg/ssh/ssh.go#L88 Declaring fish as unsupported is another option... "it hurts when I do this" |
While not part of posix to my knowledge, Having used fish as my default shell for years I don't really see much reason to adapt the scripts specifically so that they work within fish if it's an option to just use a temporary file. All of those quirks are probably things that can be dealt with, but temporary files seem like a much more reliable solution, and it also improves compatibility with any other non-posix login shell (ex. nushell, xonsh, elvish, or powershell, though I've only ever heard of one person using any of those as a login shell) |
The I wonder if we can replace |
|
Description
When setting the lima VM user's shell to fish, lima will get stuck forever waiting for the the SSH requirement to be satisfied.
lima-start.log
The loop is in the following lines:
Lima is running a script that was presumably meant for bash or another standard shell, but it runs it in whatever the user's configured shell is. If the user's shell is set to fish, this causes syntax a syntax error.
Reproduced on alpine & fedora VMs. I can provide any extra logs or make some dedicated VMs specifically for testing this if needed.
OS: Mac OS 14.7.1
CPU: Apple M1 Pro
Lima version: 1.0.0 (via homebrew)
The text was updated successfully, but these errors were encountered: