mirror of
				https://github.com/tmux-plugins/tmux-resurrect.git
				synced 2025-11-04 00:46:04 +00:00 
			
		
		
		
	Add cmdline strategy
This commit is contained in:
		
				
					committed by
					
						
						*Kim Zick (rummik)
					
				
			
			
				
	
			
			
			
						parent
						
							b020b2481e
						
					
				
				
					commit
					edd8132bef
				
			
							
								
								
									
										23
									
								
								save_command_strategies/cmdline.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										23
									
								
								save_command_strategies/cmdline.sh
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,23 @@
 | 
			
		||||
#!/usr/bin/env bash
 | 
			
		||||
 | 
			
		||||
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 | 
			
		||||
 | 
			
		||||
PANE_PID="$1"
 | 
			
		||||
CPID=$(pgrep -P $PANE_PID)
 | 
			
		||||
 | 
			
		||||
exit_safely_if_empty_ppid() {
 | 
			
		||||
	if [ -z "$PANE_PID" ]; then
 | 
			
		||||
		exit 0
 | 
			
		||||
	fi
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
full_command() {
 | 
			
		||||
	[[ -z "$CPID" ]] && exit 0
 | 
			
		||||
	base64 /proc/${CPID}/cmdline
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
main() {
 | 
			
		||||
	exit_safely_if_empty_ppid
 | 
			
		||||
	full_command
 | 
			
		||||
}
 | 
			
		||||
main
 | 
			
		||||
		Reference in New Issue
	
	Block a user