* break long commands into multiple lines for readability
* fix the format of closures
We generally write `{|| ...}` instead of `{ || ...}`.
* remove the `$"--opt=(val)"` structure when possible
`starship` does not require to use `--opt=val` and so we do not
need to do that with Nushell :)
the only place where this is required is with `--status` because
`$env.LAST_EXIT_CODE` can be negative and `starship` does not
appear to *like* values of the form `-2`...
so i left this line as it was.
on the other hand, `$env.CMD_DURATION_MS` and `(term size).columns`
should be fine 😌
* simplify the `config` mutation with new `?` syntax
This is a new very handy feature of Nushell which gives a much
simpler command combined with `default` and `merge`.
* put all `let-env`s inside an `export-env` with `load-env`
This commit has two reasons of existing:
- i think it makes it a bit easier to read with less `let-env`s
- it transforms the *script* into both a valid module and a valid
overlay
* bump the version to `0.78` in to docs
* add a note about the init file being also a module to all docs
* tweak the documentation
* update the Nushell part of the install script
* format the vuepress config file
as previous commit 117580136d3da5e00a4ccb7ada508c8510a2e50e was
not successful, let's try to make the CI happy manually 😌
* remove code quotes in the `config_cmd` of Nushell
* format the style in the Nushell `warning` section
Handles starship.install (MSI installer) and starship.portable and makes starship an
empty meta-package that only depends on starship.install. MSI/installer packages
seem to be preferred over zip-based installers on chocolatey. Proper virtual packages
that allow choosing either a portable or install variant aren't implemented in chocolatey yet.
Improve Nushell installation instruction
Consistently use `save -f` rather than `save`; the latter fails if the
file already exists
Signed-off-by: Michel Alexandre Salim <michel@michel-slm.name>
* chore(install): fix typo in help message
* chore(install): drop trailing `s` for consistency
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
By default, unzip will attempt to query the user when files to be
installed already exist. Unfortunately, if the install script is run
with `sh -s`, unzip will read the remaining portion of the script as
input, resulting in a mess on the terminal.
This commit changes the unzip behavior to clobber existing files: this
already happens for platforms using tar, so it's not hugely breaking
(and I could find no evidence that we believe this is more likely to
cause issues on Windows)
The installation script warns about `BIN_DIR` not being found in `$PATH`
when the users pass a trailing forward slash.
This has been discussed in #1310, #1341, and #3486.
Fixes#3493
* feat: add support for cmd
* add preprompt and precmd support
* add keymap support
* add info about minimum Clink version
* simplify escaping
* add handling for cmd custom commands
* add support for transient_prompt and transient_rprompt
* Revert 914057952508e81e20086fcb707ba2a0be85fdd3
This reverts commit "add support for transient_prompt and transient_rprompt"
* Apply suggestions from code review
* disable cmd shell custom commands
* any shell other than cmd can be used
* better error and correct script location
* move shell check in `map_no_escaping`
* Refactored the usage function to use printf
Using printf to print the usage function instead of a here doc handles
the formatting for us so it will be consistent across a wide variety of
terminal emulators. Here docs also tend to mess up auto-formatters so
removing it has that added benefit.
* Made the install instructions their own function
The function loops through simular install instructions so this way we
won't have to repeat ourselves every time we add a new supported shell.
* Set default config_file location
The default location is based on the name of the shell. It is overwritten when needed.
Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
* feat: add support for xonsh
* xonsh: add STARSHIP_SESSION_KEY
* xonsh: implement STARSHIP_SESSION_KEY in xonsh
* docs: mention tcsh, elvish, and nu in more places
* xonsh: change STARSHIP_SESSION_KEY implementation
See https://github.com/starship/starship/pull/2807#discussion_r667064149
* xonsh: fix jobs implementation
* xonsh: do not silently discard stderr from starship
* feat: add support for tcsh
* add tcsh to install.sh install message
* list tcsh in bug_report.rs and main.rs
* quote starship path
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* fix job count
* add tcsh support to shell module
* fix STARSHIP_START_TIME undefined error
* preserve existing user precmd and postcmd, remove jobs support
* remove unnecessary parentheses
* minor script improvement
* removes parens from install script message
* Update docs/config/README.md
Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
* fix(Tcsh): remove unecessary quotes
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
- update shebang to support posix-compliant shells (like dash)
- replace all usages of echo with printf (to normalise)
- command variable to fetch_cmd as it overloads a posix
- rename complete function to completed as it overloads
the bash builtin for completion
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* feat: add support for tcsh
* add tcsh to install.sh install message
* list tcsh in bug_report.rs and main.rs
* quote starship path
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
* fix job count
* add tcsh support to shell module
* fix STARSHIP_START_TIME undefined error
* preserve existing user precmd and postcmd, remove jobs support
* remove unnecessary parentheses
* minor script improvement
* removes parens from install script message
* Update docs/config/README.md
Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
Co-authored-by: David Knaack <davidkna@users.noreply.github.com>
Co-authored-by: Thomas O'Donnell <andytom@users.noreply.github.com>
We have had a few issues where users haave run the install script and
have ended up with a non-functioning version of starship because their
system doesn't have a required lib that we link against. To avoid these
problems it seems the easiest solution is to default to using the
statically compiled musl binaries. If a user knows that they are doing
they can use the non-statically compiled binaries by supplying the `-p`
argument to the installer. Note this is what other rust based tools such
as ripgrep do.
Adds several cross-platform utility functions to the install.sh script and
rewrites core functionality so that it might work on Windows. Among these are:
- Correct platform extensions to match the output of `detect_platform`
- Check to make sure installation directory actually exists
- If sudo is not available, print a message asking the user to manually
escalate
- Unpack zip files (used for Windows builds) without using pipes, since zip
files cannot be read through pipes
After these changes, install.sh works on a testing copy of Git Bash on Windows,
though it still has known issues (e.g. if the `unzip` program is not installed,
it will crash).