Skip to content

Commit

Permalink
clear screen before sending command by default
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHicks committed Dec 29, 2021
1 parent 1b07c7f commit 51e7143
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkgs/kak-tmux-command/rc/kak-tmux-command.kak
Expand Up @@ -2,6 +2,8 @@ declare-option -docstring "tmux pane ID to target" str tmux_command_target 1

declare-option -docstring "command to send" str tmux_command_command ""

declare-option -docstring "clear screen before sending command" bool tmux_command_clear true

define-command -override tmux-send-command -params 0.. -command-completion -docstring "send a command to the target pane" %{
evaluate-commands %sh{
if test "$#" -gt 0; then
Expand All @@ -13,6 +15,10 @@ define-command -override tmux-send-command -params 0.. -command-completion -docs
COMMAND="$kak_opt_tmux_command_command"
fi
if test "$kak_opt_tmux_command_clear" = "true"; then
tmux send-keys -t "$kak_opt_tmux_command_target" "C-l" > /dev/null 2>&1
fi
tmux send-keys -t "$kak_opt_tmux_command_target" "$COMMAND" "Enter" > /dev/null 2>&1
}
}
Expand Down

0 comments on commit 51e7143

Please sign in to comment.