-
Notifications
You must be signed in to change notification settings - Fork 11
Add fish shell compatible output #10
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I think it is a good feature, but I am unsure if --shell fish
is a good option. Do you know of any other examples?
I checked how ssh-agent
does.
ssh-agent -s
outputs Bourne shell commands:SSH_AUTH_SOCK=/path/to/sock; export SSH_AUTH_SOCK;
.ssh-agent -c
outputs a C-shell command:setenv SSH_AUTH_SOCK /path/to/sock
.- If not specified,
ssh-agent
automatically checks if the environment variableSHELL
ends with "csh".
And fish users seem to use eval (ssh-agent -c)
.
If we follow ssh-agent
, it might be good to print setenv
when --csh
is given.
### 2. Modify `.bashrc` (or `.zshrc` if you are using `zsh`) | ||
### 2. Modify your shell's rc file | ||
|
||
Bash or Zsh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bash or Zsh | |
#### Bash or Zsh |
eval $($HOME/wsl2-ssh-agent) | ||
``` | ||
|
||
Fish |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fish | |
#### Fish |
|
||
``` | ||
if status is-login | ||
$HOME/wsl2-ssh-agent | source |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be $HOME/wsl2-ssh-agent --shell fish | source
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, good catch. Will fix.
|
||
* Open the "Services" app and check that "OpenSSH Authentication Agent" service is installed and running. | ||
* Check that `ssh your-machine` works perfect on cmd.exe or PowerShell, not on WSL2. | ||
- Open the "Services" app and check that "OpenSSH Authentication Agent" service is installed and running. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is no particular reason, please do not change these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, yeah, I'll fix.
EDIT: So it seems Prettier is a fan of using -
for unordered lists instead of *
, hence how this change sneaked in on me. I'll change it back if you want, or keep it to be "more standards compliant". I don't really care either way, but if it stays this way you'll be good to go if you decide to start using it for formatting.
I have reconsidered. I don't think it's a good idea to include the |
Maybe this is a good choice? command -v export &>/dev/null && export A=1 || set A 1;: Edit: I think we may need an option like |
I agree that a switch for each shell seems antiquated. I was going to do that first then changed to the current |
How about this.
Just in case, I want to leave room for future extensions, such as @Hill-98 I like polyglot too, but I am afraid that ordinary users might be suspicious when they see the output. |
Fixes #10 Co-Authored-by: chksome <chksome@protonmail.com>
Better solution in #11. Closing this one. |
This adds a new argument
-shell
and the option to print fish shell compatible output. The default is still bash/zsh compatible output.Documentation updated to match.