Skip to content

Instantly share code, notes, and snippets.

@aaronedev
Created February 20, 2025 11:57
Show Gist options
  • Select an option

  • Save aaronedev/eeab67d72e03bceee4c0e238cadb768e to your computer and use it in GitHub Desktop.

Select an option

Save aaronedev/eeab67d72e03bceee4c0e238cadb768e to your computer and use it in GitHub Desktop.
removing blank space at the top of the shell for bash when setting add_newline = false
#!/bin/sh
show_newline() {
if [ -z "$NEW_LINE_BEFORE_PROMPT" ]; then
NEW_LINE_BEFORE_PROMPT=1
elif [ "$NEW_LINE_BEFORE_PROMPT" -eq 1 ]; then
echo ""
fi
}
PROMPT_COMMAND="show_newline"
eval "$(starship init bash)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment