added ssh_terminfo to copy terminfo to remote ssh host
This commit is contained in:
		
							
								
								
									
										19
									
								
								ssh_terminfo.py
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										19
									
								
								ssh_terminfo.py
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,19 @@
 | 
				
			|||||||
 | 
					#!/bin/python
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import os
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					path = os.path.expanduser('~') + "/.ssh/config"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					f = open(path,"r")
 | 
				
			||||||
 | 
					lines = f.readlines()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ping -c 1 -w 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					print(lines.count())
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					for l in lines:
 | 
				
			||||||
 | 
					    if "host " in l:
 | 
				
			||||||
 | 
					        ssh_host = l.split()[1]
 | 
				
			||||||
 | 
					        command = f"infocmp | ssh {ssh_host} 'tic -x /dev/stdin'"
 | 
				
			||||||
 | 
					        print("Sending terminfo to: " + ssh_host)
 | 
				
			||||||
 | 
					        print("Command: " + command)
 | 
				
			||||||
		Reference in New Issue
	
	Block a user