Skip to content
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

Add option to use ssh alias instead of hostname #332

Open
pedvide opened this issue Oct 28, 2021 · 1 comment
Open

Add option to use ssh alias instead of hostname #332

pedvide opened this issue Oct 28, 2021 · 1 comment

Comments

@pedvide
Copy link

pedvide commented Oct 28, 2021

Is your feature request related to a problem? Please describe.
In my job, I ssh into a set of machines I have ssh aliases for. The hostnames can be quite long and not informative.

Describe the solution you'd like
I have short and informative ssh aliases set up for those machines. I'd like to see them instead of the hostname in my prompt. Eg:
instead of username > long-uninformative-hostname > ..., I'd like username > my-server > ...

@scop
Copy link
Contributor

scop commented Sep 21, 2022

While I see how this would be useful, I'm not aware of a way powerline-go could do this on its own, as ssh doesn't send the alias you were using to the remote side where the prompt gets rendered.

If one is willing to go through some trouble for this and has necessary permissions, I guess this could be done is by configuring the ssh client to set an environment variable to the value desired to be rendered at the remote end when accessed with your alias, making sure that the remote sshd is configured to accept that environment variable, and configuring the remote powerline-go to display a segment with that variable with -shell-var/-shell-var-no-warn-empty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants