diff options
author | tv <tv@krebsco.de> | 2019-02-05 13:11:46 +0100 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2019-02-08 05:19:48 +0100 |
commit | 4e50762689b334f305189bf60dd3b96029a92d97 (patch) | |
tree | aad4224f27f58d670aaba785b480236dd6945eae /tv/5pkgs/simple | |
parent | 14a017e9e1b6784ac59c616821936e736cddad73 (diff) |
tv bash-fzf-history: support unknown timestamps
Diffstat (limited to 'tv/5pkgs/simple')
-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 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" |