mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 08:46:08 +03:00
Merge branch 'bash-prompt-marks'
This commit is contained in:
@ -101,6 +101,17 @@ function __ghostty_precmd() {
|
||||
PS1=$PS1'\[\e]133;B\a\]'
|
||||
PS2=$PS2'\[\e]133;B\a\]'
|
||||
|
||||
if [[ "${PS1}" == *"\n"* || "${PS1}" == *$'\n'* ]]; then
|
||||
# bash doesn't redraw the leading lines in a multiline prompt so
|
||||
# mark the last line as a secondary prompt (k=s) to prevent the
|
||||
# preceding lines from being erased by ghostty after a resize.
|
||||
builtin local oldval
|
||||
oldval=$(builtin shopt -p extglob)
|
||||
builtin shopt -s extglob
|
||||
PS1=${PS1%@('\n'|$'\n')*}'\n\[\e]133;A;k=s\a\]'${PS1##*@('\n'|$'\n')}
|
||||
builtin eval "$oldval"
|
||||
fi
|
||||
|
||||
# Cursor
|
||||
if test "$GHOSTTY_SHELL_INTEGRATION_NO_CURSOR" != "1"; then
|
||||
PS1=$PS1'\[\e[5 q\]'
|
||||
|
Reference in New Issue
Block a user