Skip to content

Add NU_VERSION environment variable on startup - #10177

Merged
kubouch merged 2 commits into
nushell:mainfrom
kubouch:nu-version-env
Sep 1, 2023
Merged

kubouch merged 2 commits into
nushell:mainfrom
kubouch:nu-version-env

Conversation

@kubouch

@kubouch kubouch commented Aug 31, 2023 •

Copy link
Copy Markdown
Contributor

Description

Similar to bash or zsh, this PR makes Nushell add NU_VERSION environment variable on startup containing Nushell's version. Unlike bash/zsh, this env var is passed to a child process so that the process can discover whether it has been launched from Nushell. Currently (AFAIK), a child process does not have a reliable cross-platform way to tell whether it has been spawned from Nushell or not.

User-Facing Changes

> $env.NU_VERSION
0.84.1

> bash -c 'echo $NU_VERSION'
0.84.1

No breaking changes.

Tests + Formatting

After Submitting

@fdncred

fdncred commented Aug 31, 2023 •

Copy link
Copy Markdown
Contributor

I was going to eventually put up a PR to set $env.SHELL too across all platforms. Want to include it in this PR?

Scratch that. I see what you said on Discord.

@kubouch

kubouch commented Aug 31, 2023

Copy link
Copy Markdown
Contributor Author

Yeah, SHELL env var would interfere with the SHELL set by the system, probably it's better to avoid it.

@sophiajt

Copy link
Copy Markdown
Contributor

Kinda makes me wish that semver versions were a builtin data types 🤔

But strings are good for now

@kubouch
kubouch merged commit d28f728 into nushell:main Sep 1, 2023
@kubouch
kubouch deleted the nu-version-env branch September 1, 2023 06:48
@fdncred fdncred added the notes:mention Noted in "Hall of Fame" section label Sep 4, 2023
amtoine added a commit to nushell/nushell.github.io that referenced this pull request Sep 17, 2023
this commit removes
| author        | description                                                | url                                                     |
| ------------- | ---------------------------------------------------------- | ------------------------------------------------------- |
| @kubouch      | Add NU_VERSION environment variable on startup             | [#10177](nushell/nushell#10177) |
| @mastermach50 | changed default env file to use $nu.home_path to find home | [#10192](nushell/nushell#10192) |
| @amtoine      | support tab completion cycling                             | [#10199](nushell/nushell#10199) |

because i'm not sure they are as interesting as the conditional sourcing
and the accessibility with screen reader friendly errors.
sholderbach added a commit to nushell/nushell.github.io that referenced this pull request Sep 19, 2023
* Create 2023-09-19-nushell_0_85_0.md

* add blurb about uutils/coreutils integration

* add the full template for the release notes

this commit also breaks the paragraph about uutils into multiple lines.

* add the raw table of contributions

* remove the bump / dependabot commits

* isolate the fixes

* more updates

* put all the PRs in proto sections

* move uutils PR to the correct section

* add TODOs and start completing some sections

* add the raw list of breaking changes

* add the full changelog

* write the "bug fixes" section

* fix a section title

* write the "documentation" section

* write the "making nushell better" section

this commit removes
| author        | description                                                | url                                                     |
| ------------- | ---------------------------------------------------------- | ------------------------------------------------------- |
| @kubouch      | Add NU_VERSION environment variable on startup             | [#10177](nushell/nushell#10177) |
| @mastermach50 | changed default env file to use $nu.home_path to find home | [#10192](nushell/nushell#10192) |
| @amtoine      | support tab completion cycling                             | [#10199](nushell/nushell#10199) |

because i'm not sure they are as interesting as the conditional sourcing
and the accessibility with screen reader friendly errors.

* write the "help with tests" section

* write the "changes to commands" section

* format and compact tables in the source

* write the "table themes" section

* write the `echo` section

* write the "python operators removal" section

* update the full changelog

* add proper uutils blog link

* Adds a note about mimalloc being default now (#1063)

* notes about history isolation changes

Co-authored-by: Hofer-Julian <[email protected]>

* type-o in sourcing and using

* `float` instead of `decimal` (#1064)

* `float` instead of `decimal`

* fix oopsie

* Breaking change markers

* Has nothing to do with pure documentation

* Add new commands section

* Deprecation section/ link new commands

* Fix `from` commands in the STD

* Fix subcommand std imports

* Mention removal of deprecated `--string`

* Refactor const section (#1068)

* Update 2023-09-19-nushell_0_85_0.md

Move code to code block

* add link to uutils blog post

* Small formulation tweaks to breaking changes

* cleanup dmatos part

* change link to our blogpost

* Add excerpt

* Excerpt in metadata

* Fix emphasis

---------

Co-authored-by: Darren Schroeder <[email protected]>
Co-authored-by: amtoine <[email protected]>
Co-authored-by: Filip Andersson <[email protected]>
Co-authored-by: Hofer-Julian <[email protected]>
Co-authored-by: Stefan Holderbach <[email protected]>
Co-authored-by: JT <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

notes:mention Noted in "Hall of Fame" section

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants