mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-03 16:46:18 +00:00 
			
		
		
		
	Add client focus hooks.
This commit is contained in:
		@@ -1148,6 +1148,8 @@ const struct options_table_entry options_table[] = {
 | 
			
		||||
	OPTIONS_TABLE_HOOK("client-active", ""),
 | 
			
		||||
	OPTIONS_TABLE_HOOK("client-attached", ""),
 | 
			
		||||
	OPTIONS_TABLE_HOOK("client-detached", ""),
 | 
			
		||||
 	OPTIONS_TABLE_HOOK("client-focus-in", ""),
 | 
			
		||||
 	OPTIONS_TABLE_HOOK("client-focus-out", ""),
 | 
			
		||||
	OPTIONS_TABLE_HOOK("client-resized", ""),
 | 
			
		||||
	OPTIONS_TABLE_HOOK("client-session-changed", ""),
 | 
			
		||||
	OPTIONS_TABLE_PANE_HOOK("pane-died", ""),
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										4
									
								
								tmux.1
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								tmux.1
									
									
									
									
									
								
							@@ -4402,6 +4402,10 @@ Run when a client becomes the latest active client of its session.
 | 
			
		||||
Run when a client is attached.
 | 
			
		||||
.It client-detached
 | 
			
		||||
Run when a client is detached
 | 
			
		||||
.It client-focus-in
 | 
			
		||||
Run when focus enters a client
 | 
			
		||||
.It client-focus-out
 | 
			
		||||
Run when focus exits a client
 | 
			
		||||
.It client-resized
 | 
			
		||||
Run when a client is resized.
 | 
			
		||||
.It client-session-changed
 | 
			
		||||
 
 | 
			
		||||
@@ -820,10 +820,13 @@ complete_key:
 | 
			
		||||
	tty->flags &= ~TTY_TIMER;
 | 
			
		||||
 | 
			
		||||
	/* Check for focus events. */
 | 
			
		||||
	if (key == KEYC_FOCUS_OUT)
 | 
			
		||||
	if (key == KEYC_FOCUS_OUT) {
 | 
			
		||||
		tty->client->flags &= ~CLIENT_FOCUSED;
 | 
			
		||||
	else if (key == KEYC_FOCUS_IN)
 | 
			
		||||
		notify_client("client-focus-out", c);
 | 
			
		||||
	} else if (key == KEYC_FOCUS_IN) {
 | 
			
		||||
		tty->client->flags |= CLIENT_FOCUSED;
 | 
			
		||||
		notify_client("client-focus-in", c);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* Fire the key. */
 | 
			
		||||
	if (key != KEYC_UNKNOWN) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user