Port recent Warp terminal and UI improvements
Improve tab-group search, rename focus, history navigation, shell prompt and completion handling, emoji width promotion, and macOS clipboard support. Guard unavailable settings/model-selector/undo-close views and forward the MCP OAuth callback issuer through the existing authentication flow. Adapt local changes from 14 upstream Warp commits through f571865ca3f2, reviewed from the latest 200 commits. Preserve Galaxy provider lifecycle, permissions, storage, and branding; exclude hosted/cloud infrastructure. Fix existing boolean-assertion lints and use stronger optimization with four code-generation units for the app test target to fit macOS unwind offsets. Production and dependency compilation settings remain unchanged. Validation: two clean builds and a final build; both prescribed Clippy commands with -D warnings; formatting, shell syntax and completion cleanup; 167 focused regression tests. Galaxy was not launched.
This commit is contained in:
@@ -493,32 +493,39 @@ if [ -z "$WARP_BOOTSTRAPPED" ]; then
|
||||
WARP_INPUT_REPORTING_SUPPORTED=$(warp_input_reporting_supported)
|
||||
fi
|
||||
|
||||
# If we haven't already, cache information about supported features.
|
||||
if [[ -z $WARP_PS1_EXPANSION_SUPPORTED ]]; then
|
||||
WARP_PS1_EXPANSION_SUPPORTED=$(warp_ps1_expanding_supported)
|
||||
fi
|
||||
|
||||
if [[ $WARP_PS1_EXPANSION_SUPPORTED == "1" ]]; then
|
||||
# When evaluating the PS1, we want to ensure that it's aware of the last exit code.
|
||||
# Since we captured it already and executed multiple other commands, the actual
|
||||
# last exit code has changed. So before the evaluation, we want to trick the shell
|
||||
# into returning the correct value for the $? that may be in PS1
|
||||
exit_code_hack() {
|
||||
return $1
|
||||
}
|
||||
exit_code_hack $exit_code
|
||||
deref_ps1=${WARP_PS1@P}
|
||||
local honor_ps1
|
||||
local deref_ps1=""
|
||||
local escaped_ps1=""
|
||||
if [[ "$WARP_HONOR_PS1" == "1" ]]; then
|
||||
honor_ps1="true"
|
||||
else
|
||||
# Tricking the shell into rendering the prompt
|
||||
# Note that in more modern versions of bash we could use ${PS1@P} to achieve the same,
|
||||
# but MacOS comes by default with a much older version of bash, and we want to be compatible.
|
||||
deref_ps1=$(echo -e "\n" | PS1="$WARP_PS1" BASH_SILENCE_DEPRECATION_WARNING=1 "$BASH" --norc -i 2>&1 | command -p head -2 | command -p tail -1)
|
||||
fi
|
||||
honor_ps1="false"
|
||||
|
||||
# Escaped PS1 variable
|
||||
local escaped_ps1
|
||||
if [ "$WARP_IN_MSYS2" = false ]; then
|
||||
escaped_ps1=$(warp_escape_ps1 "$(echo "$deref_ps1")")
|
||||
# If we haven't already, cache information about supported features.
|
||||
if [[ -z $WARP_PS1_EXPANSION_SUPPORTED ]]; then
|
||||
WARP_PS1_EXPANSION_SUPPORTED=$(warp_ps1_expanding_supported)
|
||||
fi
|
||||
|
||||
if [[ $WARP_PS1_EXPANSION_SUPPORTED == "1" ]]; then
|
||||
# When evaluating the PS1, we want to ensure that it's aware of the last exit code.
|
||||
# Since we captured it already and executed multiple other commands, the actual
|
||||
# last exit code has changed. So before the evaluation, we want to trick the shell
|
||||
# into returning the correct value for the $? that may be in PS1
|
||||
exit_code_hack() {
|
||||
return $1
|
||||
}
|
||||
exit_code_hack $exit_code
|
||||
deref_ps1=${WARP_PS1@P}
|
||||
else
|
||||
# Tricking the shell into rendering the prompt
|
||||
# Note that in more modern versions of bash we could use ${PS1@P} to achieve the same,
|
||||
# but MacOS comes by default with a much older version of bash, and we want to be compatible.
|
||||
deref_ps1=$(echo -e "\n" | PS1="$WARP_PS1" BASH_SILENCE_DEPRECATION_WARNING=1 "$BASH" --norc -i 2>&1 | command -p head -2 | command -p tail -1)
|
||||
fi
|
||||
|
||||
if [ "$WARP_IN_MSYS2" = false ]; then
|
||||
escaped_ps1=$(warp_escape_ps1 "$(echo "$deref_ps1")")
|
||||
fi
|
||||
fi
|
||||
|
||||
# Flush history
|
||||
@@ -661,15 +668,6 @@ if [ -z "$WARP_BOOTSTRAPPED" ]; then
|
||||
# Note WARP_SESSION_ID doesn't need to be escaped since it's a number
|
||||
# We also pass the shell's notion of `honor_ps1` to ensure it's synced correctly on the Warp-side for prompt handling.
|
||||
# This is passed as a "real boolean" via the JSON payload (string interpolated into JSON string below).
|
||||
local honor_ps1
|
||||
if [[ "$WARP_HONOR_PS1" == "1" ]]; then
|
||||
honor_ps1="true"
|
||||
# The Warp prompt preview can be rendered using the active prompt in this case (which uses prompt markers).
|
||||
escaped_ps1=""
|
||||
deref_ps1=""
|
||||
else
|
||||
honor_ps1="false"
|
||||
fi
|
||||
# We send the escaped PS1, if we are in active Warp prompt mode, for prompt preview rendering (note the shell's PS1 is unset in this case).
|
||||
if [ "$WARP_IN_MSYS2" = true ]; then
|
||||
warp_send_hook_via_kv_pairs_start "Precmd"
|
||||
|
||||
@@ -1390,6 +1390,7 @@ esac
|
||||
|
||||
# The main logic for generating completions.
|
||||
function warp_main_completer () {
|
||||
(( ${+functions[_generic]} )) || return 0
|
||||
# We want all the results listed.
|
||||
compstate[list_max]=-1
|
||||
|
||||
@@ -1422,12 +1423,17 @@ esac
|
||||
# Start by reading in the completion buffer.
|
||||
zle warp_read_completion_buffer
|
||||
|
||||
compprefuncs=( warp_mark_start_of_completions_for_compadd_override )
|
||||
comppostfuncs=( warp_mark_end_of_completions )
|
||||
COMPADD_OVERRIDE=true
|
||||
zle warp_complete_via_compadd_override_internal
|
||||
BUFFER=""
|
||||
unset COMPADD_OVERRIDE
|
||||
# Own the response frame even when compinit is missing or completion fails.
|
||||
warp_mark_start_of_completions_for_compadd_override
|
||||
{
|
||||
local -a compprefuncs=() comppostfuncs=()
|
||||
COMPADD_OVERRIDE=true
|
||||
zle warp_complete_via_compadd_override_internal
|
||||
} always {
|
||||
unset COMPADD_OVERRIDE
|
||||
warp_mark_end_of_completions
|
||||
BUFFER=""
|
||||
}
|
||||
}
|
||||
|
||||
function warp_read_completion_buffer() {
|
||||
|
||||
Reference in New Issue
Block a user