Bug fixing

This commit is contained in:
Sayantan Santra 2022-08-17 12:37:26 -05:00
parent d8369cac09
commit cd5120850c
2 changed files with 5 additions and 4 deletions

View File

@ -1,7 +1,6 @@
#!/usr/bin/env bash
x=$(tmux capture-pane -p -S '-')
x=$(tmux capture-pane -p -S '-' -J -t !)
PROMPT_PATTERN=${1:-' ) '}
result=$(echo "$x" | tac | sed -e "0,/$PROMPT_PATTERN/d" | sed "/$PROMPT_PATTERN/,\$d" | tac)
echo -n "$result" | xclip -sel clip
echo -n "$result" | xsel -ib

View File

@ -6,6 +6,8 @@ default_capture_key="g"
CAPTURE_KEY=$(tmux show-option -gqv @command-copy-key)
CAPTURE_KEY=${CAPTURE_KEY:-$default_capture_key}
default_prompt_pattern=" ) "
PROMPT_PATTERN=$(tmux show-option -gqv @command-copy-prompt-pattern)
PROMPT_PATTERN=${PROMPT_PATTERN:-$default_prompt_pattern}
tmux bind $CAPTURE_KEY run-shell "$CURRENT_DIR/plugin.sh $PROMPT_PATTERN"
tmux bind $CAPTURE_KEY new-window -n -d last-command-output -e PROMPT_PATTERN="$PROMPT_PATTERN" "$CURRENT_DIR/plugin.sh"