From 9f4c71d40ff987eca27d53eabbe5c385c018cb9f Mon Sep 17 00:00:00 2001 From: Ira Abramov Date: Wed, 19 May 2021 10:54:28 +0300 Subject: [PATCH 1/2] Add history flushes on each command to the powerline themes. --- themes/powerline-multiline/powerline-multiline.base.bash | 1 + themes/powerline-naked/powerline-naked.base.bash | 1 + themes/powerline/powerline.base.bash | 1 + 3 files changed, 3 insertions(+) diff --git a/themes/powerline-multiline/powerline-multiline.base.bash b/themes/powerline-multiline/powerline-multiline.base.bash index 7ae33f8638..33a8c398e3 100644 --- a/themes/powerline-multiline/powerline-multiline.base.bash +++ b/themes/powerline-multiline/powerline-multiline.base.bash @@ -60,6 +60,7 @@ function __powerline_prompt_command { SEGMENTS_AT_LEFT=0 SEGMENTS_AT_RIGHT=0 LAST_SEGMENT_COLOR="" + _save-and-reload-history "${HISTORY_AUTOSAVE:-0}" ## left prompt ## for segment in $POWERLINE_LEFT_PROMPT; do diff --git a/themes/powerline-naked/powerline-naked.base.bash b/themes/powerline-naked/powerline-naked.base.bash index 16b633be9f..98686075bd 100644 --- a/themes/powerline-naked/powerline-naked.base.bash +++ b/themes/powerline-naked/powerline-naked.base.bash @@ -26,6 +26,7 @@ function __powerline_left_segment { LEFT_PROMPT+="$(set_color ${params[1]} -)${pad_before_segment}${params[0]}${normal}" LAST_SEGMENT_COLOR=${params[1]} (( SEGMENTS_AT_LEFT += 1 )) + _save-and-reload-history "${HISTORY_AUTOSAVE:-0}" } function __powerline_left_last_segment_padding { diff --git a/themes/powerline/powerline.base.bash b/themes/powerline/powerline.base.bash index 43ee8be113..ed0499c7f6 100644 --- a/themes/powerline/powerline.base.bash +++ b/themes/powerline/powerline.base.bash @@ -255,6 +255,7 @@ function __powerline_prompt_command() { LEFT_PROMPT="" SEGMENTS_AT_LEFT=0 LAST_SEGMENT_COLOR="" + save-and-reload-history "${HISTORY_AUTOSAVE:-0}" if [[ -n "${POWERLINE_PROMPT_DISTRO_LOGO}" ]]; then LEFT_PROMPT+="$(set_color "${PROMPT_DISTRO_LOGO_COLOR}" "${PROMPT_DISTRO_LOGO_COLORBG}")${PROMPT_DISTRO_LOGO}$(set_color - -)" From c3d333ddc4f369806162b2cdf8ce1e321b1c413f Mon Sep 17 00:00:00 2001 From: Ira Abramov Date: Sun, 10 Oct 2021 15:25:45 +0300 Subject: [PATCH 2/2] fix based on remarks on PR --- themes/powerline-multiline/powerline-multiline.base.bash | 1 + themes/powerline-naked/powerline-naked.base.bash | 1 + themes/powerline/powerline.base.bash | 1 + 3 files changed, 3 insertions(+) diff --git a/themes/powerline-multiline/powerline-multiline.base.bash b/themes/powerline-multiline/powerline-multiline.base.bash index 33a8c398e3..f752bd7516 100644 --- a/themes/powerline-multiline/powerline-multiline.base.bash +++ b/themes/powerline-multiline/powerline-multiline.base.bash @@ -60,6 +60,7 @@ function __powerline_prompt_command { SEGMENTS_AT_LEFT=0 SEGMENTS_AT_RIGHT=0 LAST_SEGMENT_COLOR="" + _save-and-reload-history "${HISTORY_AUTOSAVE:-0}" ## left prompt ## diff --git a/themes/powerline-naked/powerline-naked.base.bash b/themes/powerline-naked/powerline-naked.base.bash index 98686075bd..dfc63f7640 100644 --- a/themes/powerline-naked/powerline-naked.base.bash +++ b/themes/powerline-naked/powerline-naked.base.bash @@ -26,6 +26,7 @@ function __powerline_left_segment { LEFT_PROMPT+="$(set_color ${params[1]} -)${pad_before_segment}${params[0]}${normal}" LAST_SEGMENT_COLOR=${params[1]} (( SEGMENTS_AT_LEFT += 1 )) + _save-and-reload-history "${HISTORY_AUTOSAVE:-0}" } diff --git a/themes/powerline/powerline.base.bash b/themes/powerline/powerline.base.bash index ed0499c7f6..ce62870329 100644 --- a/themes/powerline/powerline.base.bash +++ b/themes/powerline/powerline.base.bash @@ -255,6 +255,7 @@ function __powerline_prompt_command() { LEFT_PROMPT="" SEGMENTS_AT_LEFT=0 LAST_SEGMENT_COLOR="" + save-and-reload-history "${HISTORY_AUTOSAVE:-0}" if [[ -n "${POWERLINE_PROMPT_DISTRO_LOGO}" ]]; then