From 3e5f0a44a3405826b599de35f9901dfe4fc86351 Mon Sep 17 00:00:00 2001 From: Alex Pasmantier <47638216+alexpasmantier@users.noreply.github.com> Date: Sun, 5 Jan 2025 00:29:10 +0100 Subject: [PATCH] fix(unix): use sed instead of tail for bash and zsh default history channels (#216) Fixes #215 --- cable/unix-channels.toml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cable/unix-channels.toml b/cable/unix-channels.toml index c343a1d..572e464 100644 --- a/cable/unix-channels.toml +++ b/cable/unix-channels.toml @@ -35,13 +35,12 @@ preview_command = ":files:" # Shell history [[cable_channel]] name = "zsh-history" -source_command = "tail -r $HISTFILE | cut -d\";\" -f 2-" +source_command = "sed '1!G;h;$!d' $HISTFILE | cut -d\";\" -f 2-" [[cable_channel]] name = "bash-history" -source_command = "tail -r $HISTFILE" +source_command = "sed '1!G;h;$!d' $HISTFILE" [[cable_channel]] name = "fish-history" source_command = "fish -c 'history'" -