Open lentil32 opened 6 months ago
Sorry for delaying so long. I was quite busy in the past several weeks.
I tried smartcache eval starship init zsh
and there's no error occurs. Can you share your zsh config and starship config so that I can reproduce the problem?
Hi.
The content of $ starship init zsh
is in the first(main) thread.
Last lines of .zshrc
:
############ Eval ############
# smartcache eval opam env --switch=default --set-switch --shell zsh
# Why `--no-cmd`: https://github.com/ajeetdsouza/zoxide/issues/633
smartcache eval fasd --init auto
smartcache eval zoxide init zsh --no-cmd
smartcache eval batpipe
smartcache eval setjavahome
smartcache eval thefuck --alias
smartcache eval navi widget zsh # Ctrl + G to execute navi
smartcache eval direnv hook zsh
smartcache eval starship init zsh --print-full-init
Environment: macOS Sonoma 14 Alacritty
On my computer, manually running $ smartcache eval starship init zsh
in Alacritty(not automatically from .zshrc
) also occurs hanging.
Error occurs (stuck):
$ exec zsh $(/Users/user/.cargo/bin/starship prompt --terminal-width="$COLUMNS" --keymap="${KEYMAP:-}" --status="$STARSHIP_CMD_STATUS" --pipestatus="${STARSHIP_PIPE_STATUS[*]}" --cmd-duration="${STARSHIP_DURATION:-}" --jobs="$STARSHIP_JOBS_COUNT")
Clearly the output of this line relates to your starship configuration and the environment. I don't have a config so the output is pretty simple:
%{%}~%{%}
%{%}❯%{%}
Yours must be different. Could you please provide the output of this line and your starship config?
Yours must be different. Could you please provide the output of this line and your starship config?
I see. Here is my starship.toml
:
# Rerences:
# - https://www.codependentcodr.com/using-starship-for-terminal-prompt-goodness.html
# Get editor completions based on the config schema
"$schema" = 'https://starship.rs/config-schema.json'
format = """
$username\
$hostname\
$shlvl\
$kubernetes\
$directory\
$git_branch\
$git_commit\
$git_state\
$git_status\
$docker_context\
$package\
$cmake\
$nodejs\
$perl\
$python \
$ruby\
$rust\
$haskell\
$terraform\
$vagrant\
$nix_shell\
$conda\
$aws \
$env_var\
$cmd_duration\
$time\
$line_break\
$character"""
# Inserts a blank line between shell prompts
add_newline = true
[character]
success_symbol = " [λ](grey)"
error_symbol = " [λ](bold red)"
[directory]
format = "[:$path]($style)[$read_only]($read_only_style) "
read_only = " ro"
style = "#769ff0"
truncation_length = 3
truncation_symbol = "…/"
[git_branch]
symbol = ""
style = "bold white"
format = '[\($symbol$branch\)]($style) '
[git_commit]
tag_symbol = " tag "
[git_status]
# I don't care about untracked files or that there's a stash present.
untracked = ""
format = '([\[$conflicted$deleted$renamed$modified$staged$behind\]]($style) )'
modified = '*'
[status]
disabled = false
format = '[\[$status - $common_meaning\]](bold red)'
[time]
disabled = true
time_format = "%R" # Hour:Minute Format
format = ' $time '
[aws]
symbol = "aws "
[azure]
symbol = "az "
[bun]
symbol = "bun "
[c]
symbol = "C "
[cobol]
symbol = "cobol "
[conda]
symbol = "conda "
[crystal]
symbol = "cr "
[cmake]
symbol = "cmake "
[daml]
symbol = "daml "
[dart]
symbol = "dart "
[deno]
symbol = "deno "
[dotnet]
symbol = ".NET "
[docker_context]
symbol = "docker "
[elixir]
symbol = "exs "
[elm]
symbol = "elm "
[fennel]
symbol = "fnl "
[fossil_branch]
symbol = "fossil "
[gcloud]
symbol = "gcp "
[golang]
symbol = "go "
[gradle]
symbol = "gradle "
[guix_shell]
symbol = "guix "
[hg_branch]
symbol = "hg "
[java]
symbol = "java "
[julia]
symbol = "jl "
[kotlin]
symbol = "kt "
[lua]
symbol = "lua "
[nodejs]
symbol = "nodejs "
[memory_usage]
symbol = "memory "
[meson]
symbol = "meson "
[nim]
symbol = "nim "
[nix_shell]
symbol = "nix "
[ocaml]
symbol = "ml "
[opa]
symbol = "opa "
[package]
symbol = "pkg "
[perl]
symbol = "pl "
[php]
symbol = "php "
[pijul_channel]
symbol = "pijul "
[pulumi]
symbol = "pulumi "
[purescript]
symbol = "purs "
[python]
symbol = "py "
python_binary = ['./venv/bin/python', 'python3']
[raku]
symbol = "raku "
[ruby]
symbol = "rb "
[rust]
symbol = "rs "
[scala]
symbol = "scala "
[spack]
symbol = "spack "
[solidity]
symbol = "solidity "
# [status]
# symbol = "[x](bold red) "
[sudo]
symbol = "sudo "
[swift]
symbol = "swift "
[terraform]
symbol = "terraform "
[zig]
symbol = "zig "
[os.symbols]
Alpaquita = "alq "
Alpine = "alp "
Amazon = "amz "
Android = "andr "
Arch = "rch "
Artix = "atx "
CentOS = "cent "
Debian = "deb "
DragonFly = "dfbsd "
Emscripten = "emsc "
EndeavourOS = "ndev "
Fedora = "fed "
FreeBSD = "fbsd "
Garuda = "garu "
Gentoo = "gent "
HardenedBSD = "hbsd "
Illumos = "lum "
Linux = "lnx "
Mabox = "mbox "
Macos = "mac "
Manjaro = "mjo "
Mariner = "mrn "
MidnightBSD = "mid "
Mint = "mint "
NetBSD = "nbsd "
NixOS = "nix "
OpenBSD = "obsd "
OpenCloudOS = "ocos "
openEuler = "oeul "
openSUSE = "osuse "
OracleLinux = "orac "
Pop = "pop "
Raspbian = "rasp "
Redhat = "rhl "
RedHatEnterprise = "rhel "
Redox = "redox "
Solus = "sol "
SUSE = "suse "
Ubuntu = "ubnt "
Unknown = "unk "
Windows = "win "
I still can't reproduce the problem... Will this command block your shell?
$ starship prompt --terminal-width="$COLUMNS" --keymap="${KEYMAP:-}" --status="$STARSHIP_CMD_STATUS" --pipestatus="${STARSHIP_PIPE_STATUS[*]}" --cmd-duration="${STARSHIP_DURATION:-}" --jobs="$STARSHIP_JOBS_COUNT"
And have you confirmed that it works well after removing smartcache
?
I still can't reproduce the problem... Will this command block your shell?
$ starship prompt --terminal-width="$COLUMNS" --keymap="${KEYMAP:-}" --status="$STARSHIP_CMD_STATUS" --pipestatus="${STARSHIP_PIPE_STATUS[*]}" --cmd-duration="${STARSHIP_DURATION:-}" --jobs="$STARSHIP_JOBS_COUNT"
And have you confirmed that it works well after removing
smartcache
?
I have no problem with running that command. Also, i have no issue without smartcache and with https://github.com/lentil32/zsh-smartcache/tree/main this forked version.
Normally, split_word
is turned off (and I used emulate
to ensure that), which means a variable, say a='1 2 3'
, after expansion, say foo $a
, won't be split into multiple arguments. So I thought we no longer needed to quote them. However, for array variables and subshells, things are a bit different.
I'm not sure if I understand those tricky behaviors correctly and I cannot reproduce the problem. Could you take a look to see if the latest commit solves your problem?
Issue remains...
compdef: unknown command or service: bat
compdef: unknown command or service: rg
$(/Users/username/.cargo/bin/starship prompt --terminal-width="$COLUMNS" --keymap="${KEYMAP:-}" --status="$STARSHIP_CMD_STATUS" --pipestatus="${STARSHIP_PIPE_STATUS[*]}" --cmd-duration="${STARSHIP_DURATION:-}" --jobs="$STARSHIP_JOBS_COUNT")
$(/Users/username/.cargo/bin/starship prompt --terminal-width="$COLUMNS" --keymap="${KEYMAP:-}" --status="$STARSHIP_CMD_STATUS" --pipestatus="${STARSHIP_PIPE_STATUS[*]}" --cmd-duration="${STARSHIP_DURATION:-}" --jobs="$STARSHIP_JOBS_COUNT")
$(/Users/username/.cargo/bin/starship prompt --terminal-width="$COLUMNS" --keymap="${KEYMAP:-}" --status="$STARSHIP_CMD_STATUS" --pipestatus="${STARSHIP_PIPE_STATUS[*]}" --cmd-duration="${STARSHIP_DURATION:-}" --jobs="$STARSHIP_JOBS_COUNT")
$(/Users/username/.cargo/bin/starship prompt --terminal-width="$COLUMNS" --keymap="${KEYMAP:-}" --status="$STARSHIP_CMD_STATUS" --pipestatus="${STARSHIP_PIPE_STATUS[*]}" --cmd-duration="${STARSHIP_DURATION:-}" --jobs="$STARSHIP_JOBS_COUNT")pwd
/Users/username
$(/Users/username/.cargo/bin/starship prompt --terminal-width="$COLUMNS" --keymap="${KEYMAP:-}" --status="$STARSHIP_CMD_STATUS" --pipestatus="${STARSHIP_PIPE_STATUS[*]}" --cmd-duration="${STARSHIP_DURATION:-}" --jobs="$STARSHIP_JOBS_COUNT")
The shell works(see 6th line, there's pwd
and the result is in the next line), but that message always appears when i press enter(^M
).
My cursor position is just after the messages.
How to reproduce
In the end of
.zshrc
:Error occurs (stuck):
Content of the command:
Reference
1