matchai / spacefish

🚀🐟 The fish shell prompt for astronauts
https://spacefish.matchai.dev
MIT License
960 stars 78 forks source link

Looks different on Ubuntu? #162

Closed agarzon closed 5 years ago

agarzon commented 5 years ago

Bug Report

Current Behavior The prompt looks different in Ubuntu than CentOS.

I have dozens of servers and recently I decided to normalize all about fish and fisherman (I use ansible for uniform management) so the installation process for all servers was identical. All servers run the exact same versions and configurations... but, the ones using Ubuntu are not showing the first prompt line (the one that contains user, host, path).

Expected Behavior The prompt should be the same always regardless the distro.

Relevant Fish Configuration Plugins used in both systems:

jethrokuan/z
matchai/spacefish
laughedelic/pisces
brgmnn/fish-docker-compose

Environment

Possible Solution No idea

Additional context/Screenshots

with Centos: centos7

with Ubuntu: ubuntu

matchai commented 5 years ago

Interesting find @agarzon 🤔

The criteria for the username to appear in the prompt is for any of the following to be true:

  1. $LOGNAME != $USER
  2. $UID = 0
  3. $SSH_CONNECTION has a non-zero length

The "vps" portion is the hostname, whose criteria is that $SSH_CONNECTION has a non-zero length.

Both of those being the case, it would make sense to me that these sections aren't showing if the Ubuntu installation, for whatever reason, doesn't have a $SSH_CONNECTION value.

Would you be able to look into whether these environment variables are set on your Ubuntu installation?

agarzon commented 5 years ago

My bad, I assumed that the prompt will be homogeneous local or remote indistinctly. I was not aware of the SPACEFISH_USER_SHOW variable. https://spacefish.matchai.me/docs/Options.html#username-user

In my specific report, Ubuntu was checked locally and CentOS remotely. So it behaves in the way as it was programmed.

This setting fix it in they way I was spectating.

set SPACEFISH_USER_SHOW always

So, closing this issue. Thank you.