Also test $TMUX var for "local" host
This commit is contained in:
		
							parent
							
								
									729cbff471
								
							
						
					
					
						commit
						42e3e7cc63
					
				| 
						 | 
				
			
			@ -19,6 +19,10 @@ if-shell -b 'tmux has-session -t toto' {
 | 
			
		|||
	attach-session -t toto:1.1
 | 
			
		||||
}
 | 
			
		||||
# }}}
 | 
			
		||||
 | 
			
		||||
# If file was source from a running tmux
 | 
			
		||||
# This allow to run tmux source-file command outside of Tmux…
 | 
			
		||||
if-shell -b 'test -n $TMUX' {
 | 
			
		||||
	# If no session already exists
 | 
			
		||||
	if-shell '! tmux has-session -t toto' {
 | 
			
		||||
		display-message "Create a new session for Laptop"
 | 
			
		||||
| 
						 | 
				
			
			@ -48,3 +52,4 @@ if-shell -b 'tmux has-session -t 0' {
 | 
			
		|||
		kill-session -t 0
 | 
			
		||||
	}
 | 
			
		||||
	# }}}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -14,11 +14,18 @@
 | 
			
		|||
 | 
			
		||||
# If a session already exists {{{
 | 
			
		||||
if-shell -b 'tmux has-session -t IPR' {
 | 
			
		||||
	# If file was source from a running tmux
 | 
			
		||||
	#if-shell -b 'test -n $TMUX' {
 | 
			
		||||
	display-message "Attach to **IPR** existing session"
 | 
			
		||||
	## Attach to the first pane of the first window
 | 
			
		||||
	attach-session -t IPR:1.1
 | 
			
		||||
	#}
 | 
			
		||||
}
 | 
			
		||||
# }}}
 | 
			
		||||
 | 
			
		||||
# If file was source from a running tmux
 | 
			
		||||
# This allow to run tmux source-file command outside of Tmux…
 | 
			
		||||
if-shell -b 'test -n $TMUX' {
 | 
			
		||||
	# If no session already exists
 | 
			
		||||
	if-shell '! tmux has-session -t IPR' {
 | 
			
		||||
		display-message "Create a new session for Work"
 | 
			
		||||
| 
						 | 
				
			
			@ -34,3 +41,4 @@ if-shell '! tmux has-session -t IPR' {
 | 
			
		|||
		# Default pane should be IPR:1.1
 | 
			
		||||
		#select-pane -tIPR:1.1
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue