From 7d049403f2e73978185d2b6a68da9c324d63a753 Mon Sep 17 00:00:00 2001 From: Shantanu Date: Mon, 9 Sep 2024 16:16:49 -0700 Subject: [PATCH] setup: get status code before copying prompt --- cmd/setup/savvy.fish | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/setup/savvy.fish b/cmd/setup/savvy.fish index dabf84e..b822169 100644 --- a/cmd/setup/savvy.fish +++ b/cmd/setup/savvy.fish @@ -18,8 +18,9 @@ function __savvy_modify_prompt --description "Modify prompt for Savvy recording" # Define new fish_prompt function function fish_prompt # Call the original prompt function - set -l original_prompt (__original_fish_prompt) set -l exit_code $status + set -l original_prompt (__original_fish_prompt) + if test "$SAVVY_CONTEXT" = "record" and not string match -q '*recording*' "$fish_prompt" echo -n $original_prompt @@ -65,7 +66,7 @@ function __savvy_record_pre_exec__ --on-event fish_postexec #set -l clean_prompt (string replace -ra '\e\[[^m]*m' "" -- $prompt) # Send command to savvy and get step_id - #savvy send --prompt="$clean_prompt" $cmd + #savvy send --prompt="$clean_prompt" $cmd set -g step_id ( env SAVVY_SOCKET_PATH=$SAVVY_INPUT_FILE \ savvy send $cmd