starship / starship

☄🌌️ The minimal, blazing-fast, and infinitely customizable prompt for any shell!
https://starship.rs
ISC License
45.18k stars 1.97k forks source link

deprecation warnings on elvish 0.18.0 #3307

Closed ryanjafari closed 2 years ago

ryanjafari commented 2 years ago

Current Behavior

❯ eval (starship init elvish)
deprecation: the local: special namespace is deprecated; use the variable directly instead
[eval 4], line 5: local:cmd-start-time = 0
deprecation: legacy assignment form is deprecated, use var or set instead; migrate scripts with https://go.elv.sh/u0.17
[eval 4], line 5: local:cmd-start-time = 0
deprecation: the local: special namespace is deprecated; use the variable directly
[eval 4], line 5: local:cmd-start-time = 0
deprecation: the local: special namespace is deprecated; use the variable directly instead
[eval 4], line 6: local:cmd-end-time = 0
deprecation: legacy assignment form is deprecated, use var or set instead; migrate scripts with https://go.elv.sh/u0.17
[eval 4], line 6: local:cmd-end-time = 0
deprecation: the local: special namespace is deprecated; use the variable directly
[eval 4], line 6: local:cmd-end-time = 0
deprecation: the local: special namespace is deprecated; use the variable directly instead
[eval 4], line 7: local:cmd-duration = 0
deprecation: legacy assignment form is deprecated, use var or set instead; migrate scripts with https://go.elv.sh/u0.17
[eval 4], line 7: local:cmd-duration = 0
deprecation: the local: special namespace is deprecated; use the variable directly
[eval 4], line 7: local:cmd-duration = 0
deprecation: legacy lambda syntax is deprecated; migrate scripts with https://go.elv.sh/u0.17
[eval 4], line 9-11: fn starship-after-readline-hook [line]{
                           cmd-start-time = (/opt/homebrew/bin/starship time)
                       }
deprecation: legacy assignment form is deprecated, use var or set instead; migrate scripts with https://go.elv.sh/u0.17
[eval 4], line 10:     cmd-start-time = (/opt/homebrew/bin/starship time)
deprecation: legacy assignment form is deprecated, use var or set instead; migrate scripts with https://go.elv.sh/u0.17
[eval 4], line 14:     cmd-end-time = (/opt/homebrew/bin/starship time)
deprecation: legacy assignment form is deprecated, use var or set instead; migrate scripts with https://go.elv.sh/u0.17
[eval 4], line 15:     cmd-duration = (- $cmd-end-time $cmd-start-time)
deprecation: legacy assignment form is deprecated, use var or set instead; migrate scripts with https://go.elv.sh/u0.17
[eval 4], line 19: edit:after-readline = [ $@edit:after-readline $starship-after-readline-hook~ ]
deprecation: legacy assignment form is deprecated, use var or set instead; migrate scripts with https://go.elv.sh/u0.17
[eval 4], line 20: edit:before-readline = [ $@edit:before-readline $starship-before-readline-hook~ ]
deprecation: legacy assignment form is deprecated, use var or set instead; migrate scripts with https://go.elv.sh/u0.17
[eval 4], line 23-32: edit:prompt = {
                            # Note:
                            # Elvish does not appear to support exit status codes (--status)

                            if (== $cmd-start-time 0) {
                                /opt/homebrew/bin/starship prompt --jobs=$num-bg-jobs
                            } else {
                                /opt/homebrew/bin/starship prompt --jobs=$num-bg-jobs --cmd-duration=$cmd-duration
                            }
                        }
deprecation: legacy assignment form is deprecated, use var or set instead; migrate scripts with https://go.elv.sh/u0.17
[eval 4], line 34-43: edit:rprompt = {
                            # Note:
                            # Elvish does not appear to support exit status codes (--status)

                            if (== $cmd-start-time 0) {
                                /opt/homebrew/bin/starship prompt --right --jobs=$num-bg-jobs
                            } else {
                                /opt/homebrew/bin/starship prompt --right --jobs=$num-bg-jobs --cmd-duration=$cmd-duration
                            }
                        }

Expected Behavior

No deprecation warnings

Additional context/Screenshots

A little ahead here but I wanted to make a note of it, in elvish 0.18.0 (unreleased) and I think versions >= 0.17.0, starship yields a slew of deprecation warnings when bootstrapping starship. To be expected, elvish changed some stuff. They provide to automate the upgrade but in my experience you probably want to do this manually.

Possible Solution

Mentioned above

Environment

use readline-binding
use paths

# use github.com/zzamboni/elvish-themes/chain
# chain:init

paths:prepend /usr/local/bin
paths:prepend /Applications/Docker.app/Contents/Resources/bin
paths:prepend $E:HOME/.go/bin
paths:prepend /opt/homebrew/bin
paths:prepend $E:HOME/.local/bin
paths:prepend $E:HOME/.cargo/bin

fn elv {
  e:elvish
}

set E:EDITOR = (which code)" --wait"
set E:TALOS_EDITOR = $E:EDITOR
set E:SSH_AUTH_SOCK = '/Users/ryanjafari/Library/Containers/org.hejki.osx.sshce.agent/Data/socket.ssh'
set E:SSH_AGENT_PID = (pidof 'SSH Agent')
set E:CODE = $E:HOME/Code

eval (starship init elvish)

Starship Configuration

<unknown config>
ryanjafari commented 2 years ago

Otherwise seems to work fine... I'd ignore warnings if I knew how to configure that.

davidkna commented 2 years ago

It looks like some of these deprecation warnings cannot be fixed while retaining support for the current stable version (like the new lambda syntax). Do you know if there's an option to hide these warnings for the time being?

ryanjafari commented 2 years ago

eval (starship init elvish) 2> /dev/null seems to work...

zQueal commented 2 years ago

Just ran into this issue.

eval (starship init elvish) 2> /dev/null

Seems to be a workaround for right this second.

zQueal commented 2 years ago

Completely broken on windows as there is no way to quiet output ala 2> /dev/null.

davidkna commented 2 years ago

eval (starship init elvish) 2> nul works on Windows, or you could try using the init script from #3310.

zQueal commented 2 years ago

Very weird! I actually tried this yesterday with 2> NUL and for whatever reason, it didn't work. Beginning to think I didn't refresh the environment now...

Either way, thanks!