Comments (4)
Could you provide the output of starship init zsh
(run the command and redirect it to a file) to check what it generates? Perhaps also share the output of env
and your config file to see if it contains anything that could cause this, as I'm unable to reproduce this in a clean env after some mucking around by adding/removing things from the zsh init sequence.
from starship.
sure, here it is:
starship init zsh
output:
# ZSH has a quirk where `preexec` is only run if a command is actually run (i.e
# pressing ENTER at an empty command line will not cause preexec to fire). This
# can cause timing issues, as a user who presses "ENTER" without running a command
# will see the time to the start of the last command, which may be very large.
# To fix this, we create STARSHIP_START_TIME upon preexec() firing, and destroy it
# after drawing the prompt. This ensures that the timing for one command is only
# ever drawn once (for the prompt immediately after it is run).
zmodload zsh/parameter # Needed to access jobstates variable for STARSHIP_JOBS_COUNT
# Defines a function `__starship_get_time` that sets the time since epoch in millis in STARSHIP_CAPTURED_TIME.
if [[ $ZSH_VERSION == ([1-4]*) ]]; then
# ZSH <= 5; Does not have a built-in variable so we will rely on Starship's inbuilt time function.
__starship_get_time() {
STARSHIP_CAPTURED_TIME=$(/usr/bin/starship time)
}
else
zmodload zsh/datetime
zmodload zsh/mathfunc
__starship_get_time() {
(( STARSHIP_CAPTURED_TIME = int(rint(EPOCHREALTIME * 1000)) ))
}
fi
# The two functions below follow the naming convention `prompt_<theme>_<hook>`
# for compatibility with Zsh's prompt system. See
# https://github.com/zsh-users/zsh/blob/2876c25a28b8052d6683027998cc118fc9b50157/Functions/Prompts/promptinit#L155
# Runs before each new command line.
prompt_starship_precmd() {
# Save the status, because subsequent commands in this function will change $?
STARSHIP_CMD_STATUS=$? STARSHIP_PIPE_STATUS=(${pipestatus[@]})
# Calculate duration if a command was executed
if (( ${+STARSHIP_START_TIME} )); then
__starship_get_time && (( STARSHIP_DURATION = STARSHIP_CAPTURED_TIME - STARSHIP_START_TIME ))
unset STARSHIP_START_TIME
# Drop status and duration otherwise
else
unset STARSHIP_DURATION STARSHIP_CMD_STATUS STARSHIP_PIPE_STATUS
fi
# Use length of jobstates array as number of jobs. Expansion fails inside
# quotes so we set it here and then use the value later on.
STARSHIP_JOBS_COUNT=${#jobstates}
}
# Runs after the user submits the command line, but before it is executed and
# only if there's an actual command to run
prompt_starship_preexec() {
__starship_get_time && STARSHIP_START_TIME=$STARSHIP_CAPTURED_TIME
}
# Add hook functions
autoload -Uz add-zsh-hook
add-zsh-hook precmd prompt_starship_precmd
add-zsh-hook preexec prompt_starship_preexec
# Set up a function to redraw the prompt if the user switches vi modes
starship_zle-keymap-select() {
zle reset-prompt
}
## Check for existing keymap-select widget.
# zle-keymap-select is a special widget so it'll be "user:fnName" or nothing. Let's get fnName only.
__starship_preserved_zle_keymap_select=${widgets[zle-keymap-select]#user:}
if [[ -z $__starship_preserved_zle_keymap_select ]]; then
zle -N zle-keymap-select starship_zle-keymap-select;
else
# Define a wrapper fn to call the original widget fn and then Starship's.
starship_zle-keymap-select-wrapped() {
$__starship_preserved_zle_keymap_select "$@";
starship_zle-keymap-select "$@";
}
zle -N zle-keymap-select starship_zle-keymap-select-wrapped;
fi
export STARSHIP_SHELL="zsh"
# Set up the session key that will be used to store logs
STARSHIP_SESSION_KEY="$RANDOM$RANDOM$RANDOM$RANDOM$RANDOM"; # Random generates a number b/w 0 - 32767
STARSHIP_SESSION_KEY="${STARSHIP_SESSION_KEY}0000000000000000" # Pad it to 16+ chars.
export STARSHIP_SESSION_KEY=${STARSHIP_SESSION_KEY:0:16}; # Trim to 16-digits if excess.
VIRTUAL_ENV_DISABLE_PROMPT=1
setopt promptsubst
PROMPT='$('/usr/bin/starship' prompt --terminal-width="$COLUMNS" --keymap="${KEYMAP:-}" --status="$STARSHIP_CMD_STATUS" --pipestatus="${STARSHIP_PIPE_STATUS[*]}" --cmd-duration="${STARSHIP_DURATION:-}" --jobs="$STARSHIP_JOBS_COUNT")'
RPROMPT='$('/usr/bin/starship' prompt --right --terminal-width="$COLUMNS" --keymap="${KEYMAP:-}" --status="$STARSHIP_CMD_STATUS" --pipestatus="${STARSHIP_PIPE_STATUS[*]}" --cmd-duration="${STARSHIP_DURATION:-}" --jobs="$STARSHIP_JOBS_COUNT")'
PROMPT2="$(/usr/bin/starship prompt --continuation)"
env
output:
ALACRITTY_LOG=/tmp/Alacritty-4036.log
ALACRITTY_SOCKET=/run/user/1000/Alacritty-:0-4036.sock
ALACRITTY_WINDOW_ID=65011715
COLORTERM=truecolor
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
DEBUGINFOD_URLS=https://debuginfod.archlinux.org
DESKTOP_SESSION=awesome
DISPLAY=:0
GDMSESSION=awesome
GDM_LANG=en_US.utf8
GTK_MODULES=canberra-gtk-module
HOME=/home/<my username>
LANG=en_US.utf8
LOGNAME=<my username>
MAIL=/var/spool/mail/<my username>
MOTD_SHOWN=pam
OLDPWD=/home/<my username>
PATH=/home/<my username>/.nvm/versions/node/v20.13.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/<my username>/path/to/personal/things/
PWD=/home/<my username>
SHELL=/bin/zsh
SHLVL=1
TERM=alacritty
USER=<my username>
WINDOWID=65011715
XAUTHORITY=/home/<my username>/.Xauthority
XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/<my username>
XDG_RUNTIME_DIR=/run/user/1000
XDG_SEAT=seat0
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
XDG_SESSION_CLASS=user
XDG_SESSION_DESKTOP=awesome
XDG_SESSION_ID=2
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
XDG_SESSION_TYPE=x11
XDG_VTNR=7
_=/usr/bin/env
NVM_DIR=/home/<my username>/.nvm
NVM_CD_FLAGS=-q
NVM_BIN=/home/<my username>/.nvm/versions/node/v20.13.1/bin
NVM_INC=/home/<my username>/.nvm/versions/node/v20.13.1/include/node
GTK_THEME=Adwaita:dark
GTK2_RC_FILES=/usr/share/themes/Adwaita-dark/gtk-2.0/gtkrc
QT_STYLE_OVERRIDE=Adwaita-Dark
STARTSHIP_LOG=trace
STARSHIP_SHELL=zsh
STARSHIP_SESSION_KEY=3062071713195927
For my complete zshrc config file I will edit my op.
from starship.
Okay so there's nothing weird here that could explain why neofetch is being called. If it's only on first load of a session, then the only things I can think of are that either your global zshrc (probably somewhere in etc) or your MOTD script are calling it. You could grep -Ri neofetch /etc
and repeat that for wherever MOTD lives. But beyond that, I don't have a clue where this could come from. It doesn't seem to be starship, but none of the plugins here should be registering a different hook or pre_exec
from starship.
@RivenSkaye My bad, I had this alias being sourced in my .zshrc
alias -g clear='clear && neofetch'
anyway thank you for taking your time to troubleshoot this.
from starship.
Related Issues (20)
- custom commands not working inside starship bash shell HOT 4
- Fortune equivalent for starship?
- detect_input HOT 1
- starship in Windows PowerShell only shows the current directory
- Current interface with IP Address info HOT 1
- Windows: Escape Sequences Issue with `starship init nu` in Nushell HOT 3
- trailing spaces being removed from prompt when using nix_shell in tmux HOT 3
- Extra empty line at the top of the terminal HOT 1
- Init.nu fails after upgrading nushell from v0.93.0 to v0.94.1 HOT 2
- No Git Information/Status Shown in Prompt When Inside Git Repo With SHA256 Hashing
- [BUG] direnv style specifies a non-standard color HOT 1
- [custom] Inconsistent handling of colors from subshell when using custom module HOT 2
- Add option for aliasing known hostnames in config
- `starship module ...` not displaying any output to stdin with the exception of `starship module character`
- Kubernetes module not working on Powershell
- .gitconfig file triggers "git" section HOT 1
- [Feat.Req] P10k like instant prompt
- Starship not honoring `add_newline = false`
- over-eager language detection logic causes noisy, false info in prompts
- kubernetes module ignores detect_files setting HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from starship.