mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Add a command-error hook when a command fails, from Hugh Davenport in
GitHub issue 3973.
This commit is contained in:
		
							
								
								
									
										10
									
								
								tmux.1
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								tmux.1
									
									
									
									
									
								
							@@ -4889,6 +4889,14 @@ layout after every
 | 
			
		||||
set-hook -g after-split-window "selectl even-vertical"
 | 
			
		||||
.Ed
 | 
			
		||||
.Pp
 | 
			
		||||
If a command fails, the
 | 
			
		||||
.Ql command-error
 | 
			
		||||
hook will be fired.
 | 
			
		||||
For example, this could be used to write to a log file:
 | 
			
		||||
.Bd -literal -offset indent
 | 
			
		||||
set-hook -g command-error "run-shell \\"echo 'a tmux command failed' >>/tmp/log\\""
 | 
			
		||||
.Ed
 | 
			
		||||
.Pp
 | 
			
		||||
All the notifications listed in the
 | 
			
		||||
.Sx CONTROL MODE
 | 
			
		||||
section are hooks (without any arguments), except
 | 
			
		||||
@@ -4921,6 +4929,8 @@ Run when focus exits a client
 | 
			
		||||
Run when a client is resized.
 | 
			
		||||
.It client-session-changed
 | 
			
		||||
Run when a client's attached session is changed.
 | 
			
		||||
.It command-error
 | 
			
		||||
Run when a command fails.
 | 
			
		||||
.It pane-died
 | 
			
		||||
Run when the program running in a pane exits, but
 | 
			
		||||
.Ic remain-on-exit
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user