Created
March 5, 2024 13:04
-
-
Save AntonFriberg/47d9689753ba2814914fd9d3d084e2c4 to your computer and use it in GitHub Desktop.
Fish function for transferring terminfo to remote server over ssh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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