Skip to content

Ability to show current Node.js version#128

Open
imposibrus wants to merge 1 commit intooh-my-fish:masterfrom
imposibrus:master
Open

Ability to show current Node.js version#128
imposibrus wants to merge 1 commit intooh-my-fish:masterfrom
imposibrus:master

Conversation

@imposibrus
Copy link
Copy Markdown

Possible fix for #97

@rcalabro
Copy link
Copy Markdown

Is this going to be merged?

@bobthecow
Copy link
Copy Markdown
Member

In all the other "version" segments (virtualenv, rvm, etc) the segment isn't showing the current version of the language, it's showing the current state of the virtual environment. That this happens to show the language version is a bit irrelevant.

For this to be consistent with those, it would probably show the version supplied by NVM (or other node environment manager), along with any equivalent to ruby bundles.

Additionally, if the current environment version is the "system" or "default", the other language segments don't show at all. This is in keeping with the bobthefish principle that default states should be omitted whenever possible, so that emphasis is placed on what is different, not what is always the same.

So to move forward with this… What is setting your node version?

@rcalabro
Copy link
Copy Markdown

I think the best option would be to use the active NVM version.

Comment thread fish_prompt.fish
__bobthefish_start_segment $__color_node
set -l node_version (node --version)
echo -ns $__bobthefish_node_glyph
echo -ns $white $node_version
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

where does $white come from?

Comment thread fish_prompt.fish
set __color_rvm $red $grey --bold
set __color_virtualfish $blue $grey --bold
set __color_virtualgo $blue $grey --bold
set __color_node 026e00 $colorfg --bold
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

there's no $colorfg here.

Comment thread fish_prompt.fish
set __color_rvm $ruby_red $grey[1] --bold
set __color_virtualfish $blue[2] $grey[1] --bold
set __color_virtualgo $blue[2] $grey[1] --bold
set __color_node 026e00 $colorfg --bold
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

there's no $colorfg here.

Comment thread fish_prompt.fish
set __color_rvm $red[2] $fg[2] --bold
set __color_virtualfish $blue[2] $fg[2] --bold
set __color_virtualgo $blue[2] $fg[2] --bold
set __color_node 026e00 $colorfg --bold
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

there's no $colorfg here.

Comment thread fish_prompt.fish
set __color_rvm $ruby_red $grey[1] --bold
set __color_virtualfish $blue[2] $grey[1] --bold
set __color_virtualgo $blue[2] $grey[1] --bold
set __color_node 026e00 $colorfg --bold
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

there's no $colorfg here.

@alessandro-fazzi alessandro-fazzi mentioned this pull request Jun 26, 2019
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.

3 participants