Skip to content

Add a username/hostname section to the prompt#62

Open
thenktor wants to merge 6 commits intojorgebucaran:mainfrom
thenktor:main
Open

Add a username/hostname section to the prompt#62
thenktor wants to merge 6 commits intojorgebucaran:mainfrom
thenktor:main

Conversation

@thenktor
Copy link

When connecting to remote hosts via ssh or when entering containers (Linux LXC, FreeBSD jails, Solaris zones) it is nice to see where you are working now. Therefore I've added a username/hostname section to the beginning of the prompt.

It always show username@hostname for remote/container prompts. You can set activate hydro_always_show_user to always show the username. Useful when using su to change user on local machines.

Fix for #50

@wunki
Copy link

wunki commented Mar 21, 2025

I would love to see this merged, I am looking for similar functionality.

set show_hostname true
end
end
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of performing all these checks on every prompt, given these parts of the environment wouldn't change during a given shell session, should this be cached?

I could also imagine there's scenarios where someone may wish to show the hostname, but this currently won't allow doing so on custom conditions.

Copy link
Author

@thenktor thenktor Mar 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest: I'm using the default fish prompt on all servers where one of these checks would turn on the show_hostname 😄 Probably a simple option hydro_always_show_hostname would be just as good, too. I cannot remember why I've added the automatic checks. Probably just because it was possible.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants