summaryrefslogtreecommitdiffstats
path: root/tv/5pkgs/simple/bash-fzf-history.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2019-02-05 11:54:03 +0100
committertv <tv@krebsco.de>2019-02-05 11:54:03 +0100
commit79267b99a05a94df40c33ff5f7c651f83ed9334e (patch)
treefc95230f066f21beba9605610771c8346a0d0561 /tv/5pkgs/simple/bash-fzf-history.nix
parent56d8366cfd011a0079ad731438f48280edfcbdca (diff)
tv bash-fzf-history: show timestamp
Diffstat (limited to 'tv/5pkgs/simple/bash-fzf-history.nix')
-rw-r--r--tv/5pkgs/simple/bash-fzf-history.nix7
1 files changed, 5 insertions, 2 deletions
diff --git a/tv/5pkgs/simple/bash-fzf-history.nix b/tv/5pkgs/simple/bash-fzf-history.nix
index 8b3fe9e58..7b92ea0cd 100644
--- a/tv/5pkgs/simple/bash-fzf-history.nix
+++ b/tv/5pkgs/simple/bash-fzf-history.nix
@@ -35,8 +35,9 @@ with import <stockholm/lib>;
__fzf_history__() (
IFS=$'\n'
result=( $(
- HISTTIMEFORMAT= history |
+ HISTTIMEFORMAT=$'\e[38;5;244m%Y-%m-%dT%H:%M:%S\e[m ' history |
FZF_DEFAULT_OPTS="${toString [
+ /* sh */ "--ansi"
/* sh */ "--tac"
/* sh */ "--sync"
/* sh */ "-n2..,.."
@@ -51,13 +52,15 @@ with import <stockholm/lib>;
/^ *[0-9]/{
s/^ *//
s/ \+/\n/;# index
+ s/ \+/\n/;# date
}
'
) )
if test -n "$result"; then
key=''${result[0]}
index=''${result[1]}
- command=''${result[2]}
+ date=''${result[2]}
+ command=''${result[3]}
echo "$command${mark-prefix}$key"
else