From 971a2e7697d888a09f21fb50a2684e6162ac6329 Mon Sep 17 00:00:00 2001 From: Alex Pasmantier <47638216+alexpasmantier@users.noreply.github.com> Date: Thu, 2 Jan 2025 13:45:45 +0100 Subject: [PATCH] refactor(shell): use $HISTFILE for cable history channels (#210) Fixes #209 --- cable/unix-channels.toml | 4 ++-- cable/windows-channels.toml | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/cable/unix-channels.toml b/cable/unix-channels.toml index b4985c1..c343a1d 100644 --- a/cable/unix-channels.toml +++ b/cable/unix-channels.toml @@ -35,11 +35,11 @@ preview_command = ":files:" # Shell history [[cable_channel]] name = "zsh-history" -source_command = "tail -r $HOME/.zsh_history | cut -d\";\" -f 2-" +source_command = "tail -r $HISTFILE | cut -d\";\" -f 2-" [[cable_channel]] name = "bash-history" -source_command = "tail -r $HOME/.bash_history" +source_command = "tail -r $HISTFILE" [[cable_channel]] name = "fish-history" diff --git a/cable/windows-channels.toml b/cable/windows-channels.toml index fbda4b0..0c6c870 100644 --- a/cable/windows-channels.toml +++ b/cable/windows-channels.toml @@ -19,3 +19,18 @@ preview_command = "git show -p --stat --pretty=fuller --color=always {0}" name = "docker-images" source_command = "docker image list --format \"{{.ID}}\"" preview_command = "docker image inspect {0} | jq -C" + +# Shell history +[[cable_channel]] +name = "zsh-history" +source_command = "tail -r $HISTFILE | cut -d\";\" -f 2-" + +[[cable_channel]] +name = "bash-history" +source_command = "tail -r $HISTFILE" + +[[cable_channel]] +name = "fish-history" +source_command = "fish -c 'history'" + +