refactor(shell): use $HISTFILE for cable history channels (#210)

Fixes #209
This commit is contained in:
Alex Pasmantier 2025-01-02 13:45:45 +01:00 committed by GitHub
parent 9079ed794c
commit 971a2e7697
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 2 deletions

View File

@ -35,11 +35,11 @@ preview_command = ":files:"
# Shell history # Shell history
[[cable_channel]] [[cable_channel]]
name = "zsh-history" 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]] [[cable_channel]]
name = "bash-history" name = "bash-history"
source_command = "tail -r $HOME/.bash_history" source_command = "tail -r $HISTFILE"
[[cable_channel]] [[cable_channel]]
name = "fish-history" name = "fish-history"

View File

@ -19,3 +19,18 @@ preview_command = "git show -p --stat --pretty=fuller --color=always {0}"
name = "docker-images" name = "docker-images"
source_command = "docker image list --format \"{{.ID}}\"" source_command = "docker image list --format \"{{.ID}}\""
preview_command = "docker image inspect {0} | jq -C" 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'"