summaryrefslogtreecommitdiffstats
path: root/tv/5pkgs/simple
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
commit0b60d5da163980483a233ab60492c9c5a5c59cf8 (patch)
treebd555229448de6511e2e0c7ec95e911e7081d351 /tv/5pkgs/simple
parentc1bd2a0851dc163a77699b00759f8ae4aa38a65d (diff)
tv bash-fzf-history: support unknown timestamps
Diffstat (limited to 'tv/5pkgs/simple')
-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 7b92ea0cd..b603dedd9 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"