summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2019-02-05 13:11:46 +0100
committerlassulus <lassulus@lassul.us>2019-02-08 05:19:48 +0100
commit4e50762689b334f305189bf60dd3b96029a92d97 (patch)
treeaad4224f27f58d670aaba785b480236dd6945eae
parent14a017e9e1b6784ac59c616821936e736cddad73 (diff)
tv bash-fzf-history: support unknown timestamps
-rw-r--r--tv/5pkgs/simple/bash-fzf-history.nix5
1 files changed, 5 insertions, 0 deletions
diff --git a/tv/5pkgs/simple/bash-fzf-history.nix b/tv/5pkgs/simple/bash-fzf-history.nix
index 7b92ea0..b603ded 100644
--- a/tv/5pkgs/simple/bash-fzf-history.nix
+++ b/tv/5pkgs/simple/bash-fzf-history.nix
@@ -35,7 +35,12 @@ with import <stockholm/lib>;
__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"