Skip to content

Instantly share code, notes, and snippets.

@AntonFriberg
Created March 5, 2024 13:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AntonFriberg/47d9689753ba2814914fd9d3d084e2c4 to your computer and use it in GitHub Desktop.
Save AntonFriberg/47d9689753ba2814914fd9d3d084e2c4 to your computer and use it in GitHub Desktop.
Fish function for transferring terminfo to remote server over ssh
function ssht
# Set the remote server's address
set remote_server $argv[1]
# Export the terminal info to a temporary file
set tmp_file (mktemp)
infocmp >$tmp_file
# Transfer the terminfo file to the remote server
scp $tmp_file $remote_server:/tmp/
# Set the name for the remote temporary file
set remote_tmp_file "/tmp/"(basename $tmp_file)
# Load the terminfo on the remote server
ssh $remote_server "tic -x $remote_tmp_file"
# Clean up temporary files
rm $tmp_file
ssh $remote_server "rm $remote_tmp_file"
echo "Terminfo for $term_type transferred and installed on $remote_server"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment