Don't fire fish_prompt when read is used

Apart from being semantically incorrect, this was causing `fish_prompt`
to fire twice after commands that used `read` (e.g. `cdh`).

Closes #7039.
This commit is contained in:
Mahmoud Al-Qudsi
2020-05-26 15:24:31 -05:00
parent e885a65754
commit 2d52335fed
4 changed files with 7 additions and 4 deletions

View File

@@ -218,10 +218,12 @@ function __fish_config_interactive -d "Initializations that should be performed
# Load key bindings
__fish_reload_key_bindings
# Enable bracketed paste exception when running unit tests so we don't have to add
# the sequences to bind.expect
if not set -q FISH_UNIT_TESTS_RUNNING
# Enable bracketed paste before every prompt (see __fish_shared_bindings for the bindings).
# Disable it for unit tests so we don't have to add the sequences to bind.expect
function __fish_enable_bracketed_paste --on-event fish_prompt
# Enable bracketed paste when the read builtin is used.
function __fish_enable_bracketed_paste --on-event fish_prompt --on-event fish_read
printf "\e[?2004h"
end