Skip to content

Commit

Permalink
prevent prompt new line on warp terminal
Browse files Browse the repository at this point in the history
  • Loading branch information
sha1n committed May 6, 2024
1 parent 018b1fd commit 70cbf96
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
22 changes: 22 additions & 0 deletions include/prompt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env zsh

#
# Starts a new line at the end of the prompt
#
function prompt_end() {
if [[ -n $CURRENT_BG ]]; then
print -n "%{%k%F{$CURRENT_BG}%}$SEGMENT_SEPARATOR"
else
print -n "%{%k%}"
fi

# Warp already adds a new line at the end of the prompt
if [[ $TERM_PROGRAM == "WarpTerminal" ]]; then
CURRENT_BG=''
return
fi

print -n "\n❯%{%f%}"

CURRENT_BG=''
}
1 change: 1 addition & 0 deletions load.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ source $SHA1N_PROFILE_HOME/include/functions
source $SHA1N_PROFILE_HOME/include/keybindings
source $SHA1N_PROFILE_HOME/include/completions
source $SHA1N_PROFILE_HOME/include/history
source $SHA1N_PROFILE_HOME/include/prompt

0 comments on commit 70cbf96

Please sign in to comment.