mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Add a copy-command option and change copy-pipe and friends to pipe to it
if used without arguments, allows all copy key bindings to be changed to pipe with one option.
This commit is contained in:
		@@ -333,10 +333,10 @@ key_bindings_init(void)
 | 
			
		||||
		"bind -n MouseDown2Pane select-pane -t=\\; if -F '#{||:#{pane_in_mode},#{mouse_any_flag}}' { send -M } { paste -p }",
 | 
			
		||||
 | 
			
		||||
		/* Mouse button 1 double click on pane. */
 | 
			
		||||
		"bind -n DoubleClick1Pane select-pane -t=\\; if -F '#{||:#{pane_in_mode},#{mouse_any_flag}}' { send -M } { copy-mode -H; send -X select-word; run -d0.3; send -X copy-selection-and-cancel }",
 | 
			
		||||
		"bind -n DoubleClick1Pane select-pane -t=\\; if -F '#{||:#{pane_in_mode},#{mouse_any_flag}}' { send -M } { copy-mode -H; send -X select-word; run -d0.3; send -X copy-pipe-and-cancel }",
 | 
			
		||||
 | 
			
		||||
		/* Mouse button 1 triple click on pane. */
 | 
			
		||||
		"bind -n TripleClick1Pane select-pane -t=\\; if -F '#{||:#{pane_in_mode},#{mouse_any_flag}}' { send -M } { copy-mode -H; send -X select-line; run -d0.3; send -X copy-selection-and-cancel }",
 | 
			
		||||
		"bind -n TripleClick1Pane select-pane -t=\\; if -F '#{||:#{pane_in_mode},#{mouse_any_flag}}' { send -M } { copy-mode -H; send -X select-line; run -d0.3; send -X copy-pipe-and-cancel }",
 | 
			
		||||
 | 
			
		||||
		/* Mouse button 1 drag on border. */
 | 
			
		||||
		"bind -n MouseDrag1Border resize-pane -M",
 | 
			
		||||
@@ -374,7 +374,7 @@ key_bindings_init(void)
 | 
			
		||||
		"bind -Tcopy-mode C-r command-prompt -ip'(search up)' -I'#{pane_search_string}' 'send -X search-backward-incremental \"%%%\"'",
 | 
			
		||||
		"bind -Tcopy-mode C-s command-prompt -ip'(search down)' -I'#{pane_search_string}' 'send -X search-forward-incremental \"%%%\"'",
 | 
			
		||||
		"bind -Tcopy-mode C-v send -X page-down",
 | 
			
		||||
		"bind -Tcopy-mode C-w send -X copy-selection-and-cancel",
 | 
			
		||||
		"bind -Tcopy-mode C-w send -X copy-pipe-and-cancel",
 | 
			
		||||
		"bind -Tcopy-mode Escape send -X cancel",
 | 
			
		||||
		"bind -Tcopy-mode Space send -X page-down",
 | 
			
		||||
		"bind -Tcopy-mode , send -X jump-reverse",
 | 
			
		||||
@@ -393,11 +393,11 @@ key_bindings_init(void)
 | 
			
		||||
		"bind -Tcopy-mode End send -X end-of-line",
 | 
			
		||||
		"bind -Tcopy-mode MouseDown1Pane select-pane",
 | 
			
		||||
		"bind -Tcopy-mode MouseDrag1Pane select-pane\\; send -X begin-selection",
 | 
			
		||||
		"bind -Tcopy-mode MouseDragEnd1Pane send -X copy-selection-and-cancel",
 | 
			
		||||
		"bind -Tcopy-mode MouseDragEnd1Pane send -X copy-pipe-and-cancel",
 | 
			
		||||
		"bind -Tcopy-mode WheelUpPane select-pane\\; send -N5 -X scroll-up",
 | 
			
		||||
		"bind -Tcopy-mode WheelDownPane select-pane\\; send -N5 -X scroll-down",
 | 
			
		||||
		"bind -Tcopy-mode DoubleClick1Pane select-pane\\; send -X select-word\\; run -d0.3\\; send -X copy-selection-and-cancel",
 | 
			
		||||
		"bind -Tcopy-mode TripleClick1Pane select-pane\\; send -X select-line\\; run -d0.3\\; send -X copy-selection-and-cancel",
 | 
			
		||||
		"bind -Tcopy-mode DoubleClick1Pane select-pane\\; send -X select-word\\; run -d0.3\\; send -X copy-pipe-and-cancel",
 | 
			
		||||
		"bind -Tcopy-mode TripleClick1Pane select-pane\\; send -X select-line\\; run -d0.3\\; send -X copy-pipe-and-cancel",
 | 
			
		||||
		"bind -Tcopy-mode NPage send -X page-down",
 | 
			
		||||
		"bind -Tcopy-mode PPage send -X page-up",
 | 
			
		||||
		"bind -Tcopy-mode Up send -X cursor-up",
 | 
			
		||||
@@ -423,7 +423,7 @@ key_bindings_init(void)
 | 
			
		||||
		"bind -Tcopy-mode M-m send -X back-to-indentation",
 | 
			
		||||
		"bind -Tcopy-mode M-r send -X middle-line",
 | 
			
		||||
		"bind -Tcopy-mode M-v send -X page-up",
 | 
			
		||||
		"bind -Tcopy-mode M-w send -X copy-selection-and-cancel",
 | 
			
		||||
		"bind -Tcopy-mode M-w send -X copy-pipe-and-cancel",
 | 
			
		||||
		"bind -Tcopy-mode 'M-{' send -X previous-paragraph",
 | 
			
		||||
		"bind -Tcopy-mode 'M-}' send -X next-paragraph",
 | 
			
		||||
		"bind -Tcopy-mode M-Up send -X halfpage-up",
 | 
			
		||||
@@ -440,8 +440,8 @@ key_bindings_init(void)
 | 
			
		||||
		"bind -Tcopy-mode-vi C-b send -X page-up",
 | 
			
		||||
		"bind -Tcopy-mode-vi C-f send -X page-down",
 | 
			
		||||
		"bind -Tcopy-mode-vi C-h send -X cursor-left",
 | 
			
		||||
		"bind -Tcopy-mode-vi C-j send -X copy-selection-and-cancel",
 | 
			
		||||
		"bind -Tcopy-mode-vi Enter send -X copy-selection-and-cancel",
 | 
			
		||||
		"bind -Tcopy-mode-vi C-j send -X copy-pipe-and-cancel",
 | 
			
		||||
		"bind -Tcopy-mode-vi Enter send -X copy-pipe-and-cancel",
 | 
			
		||||
		"bind -Tcopy-mode-vi C-u send -X halfpage-up",
 | 
			
		||||
		"bind -Tcopy-mode-vi C-v send -X rectangle-toggle",
 | 
			
		||||
		"bind -Tcopy-mode-vi C-y send -X scroll-up",
 | 
			
		||||
@@ -499,11 +499,11 @@ key_bindings_init(void)
 | 
			
		||||
		"bind -Tcopy-mode-vi % send -X next-matching-bracket",
 | 
			
		||||
		"bind -Tcopy-mode-vi MouseDown1Pane select-pane",
 | 
			
		||||
		"bind -Tcopy-mode-vi MouseDrag1Pane select-pane\\; send -X begin-selection",
 | 
			
		||||
		"bind -Tcopy-mode-vi MouseDragEnd1Pane send -X copy-selection-and-cancel",
 | 
			
		||||
		"bind -Tcopy-mode-vi MouseDragEnd1Pane send -X copy-pipe-and-cancel",
 | 
			
		||||
		"bind -Tcopy-mode-vi WheelUpPane select-pane\\; send -N5 -X scroll-up",
 | 
			
		||||
		"bind -Tcopy-mode-vi WheelDownPane select-pane\\; send -N5 -X scroll-down",
 | 
			
		||||
		"bind -Tcopy-mode-vi DoubleClick1Pane select-pane\\; send -X select-word\\; run -d0.3\\; send -X copy-selection-and-cancel",
 | 
			
		||||
		"bind -Tcopy-mode-vi TripleClick1Pane select-pane\\; send -X select-line\\; run -d0.3\\; send -X copy-selection-and-cancel",
 | 
			
		||||
		"bind -Tcopy-mode-vi DoubleClick1Pane select-pane\\; send -X select-word\\; run -d0.3\\; send -X copy-pipe-and-cancel",
 | 
			
		||||
		"bind -Tcopy-mode-vi TripleClick1Pane select-pane\\; send -X select-line\\; run -d0.3\\; send -X copy-pipe-and-cancel",
 | 
			
		||||
		"bind -Tcopy-mode-vi BSpace send -X cursor-left",
 | 
			
		||||
		"bind -Tcopy-mode-vi NPage send -X page-down",
 | 
			
		||||
		"bind -Tcopy-mode-vi PPage send -X page-up",
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user