mirror of
https://github.com/SinTan1729/tmux_copy_last_command_output.git
synced 2025-04-11 14:16:03 -05:00
Bug fixing
This commit is contained in:
parent
d8369cac09
commit
cd5120850c
2 changed files with 5 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue