diff options
author | tv <tv@krebsco.de> | 2019-02-05 13:11:46 +0100 |
---|---|---|
committer | tv <tv@krebsco.de> | 2019-02-05 13:11:46 +0100 |
commit | 9d6875b02e05ebf9bb56247438a3386b1415eb52 (patch) | |
tree | da3a4a08105c0d42d7ebd89b0b036dcfe0fdc2f6 /tv/5pkgs | |
parent | 79267b99a05a94df40c33ff5f7c651f83ed9334e (diff) |
tv bash-fzf-history: support unknown timestamps
Diffstat (limited to 'tv/5pkgs')
-rw-r--r-- | tv/5pkgs/simple/bash-fzf-history.nix | 5 |
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" |