From 9d6875b02e05ebf9bb56247438a3386b1415eb52 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 5 Feb 2019 13:11:46 +0100 Subject: tv bash-fzf-history: support unknown timestamps --- tv/5pkgs/simple/bash-fzf-history.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tv/5pkgs/simple/bash-fzf-history.nix b/tv/5pkgs/simple/bash-fzf-history.nix index 7b92ea0c..b603dedd 100644 --- a/tv/5pkgs/simple/bash-fzf-history.nix +++ b/tv/5pkgs/simple/bash-fzf-history.nix @@ -35,7 +35,12 @@ with import ; __fzf_history__() ( IFS=$'\n' result=( $( + # To add "unknown timestamps" to each line of the history: + # sed -i '/^#[0-9]/{n;b};s/^/#1\n/' "$HISTFILE" HISTTIMEFORMAT=$'\e[38;5;244m%Y-%m-%dT%H:%M:%S\e[m ' history | + ${pkgs.gnused}/bin/sed ' + s/\(\x1b\[[0-9;]*\)244m1970-[0-9T:-]*/\1237m????-??-??T??:??:??/ + ' | FZF_DEFAULT_OPTS="${toString [ /* sh */ "--ansi" /* sh */ "--tac" -- cgit v1.2.3