sshwrap-hostcolor - SSH wrapper script to remember the terminal background you use for each host
This document describes version 0.003 of sshwrap-hostcolor (from Perl distribution App-sshwrap-hostcolor), released on 2018-09-26.
Use like you would ssh:
% sshwrap-hostcolor -v ujang@host1.example
For convenience, alias this script to ssh. In your Unix shell:
alias ssh=sshwrap-hostcolor
then you can use it like this:
% ssh -v ujang@host1.example
After you ssh to the remote host, change the background color of your terminal (e.g. to dark blue). Upon exit, the script will retrieve the terminal's current background color and record this line to ~/.sshwrap-hostcolor.history:
ujang@host1.example 00002b
Next time you ssh to the same user@host combination, the script will set the terminal's background color to dark blue.
user@host
As a bonus, you can also activate the completion script _sshwrap-hostcolor:
complete -C _sshwrap-hostcolor ssh
this will let you complete user@host and immediately change the background color to the remembered one.
To get and set terminal background color programmatically, an xterm-compatible terminal is required. Please see the list here: XTerm::Util.
String. Can be set to random-dark to automatically set the color of a new user+host with a random color between "000000" and "3f3f3f". Can be set torandom-light to automatically set the color of a new user+host with a random color between "c0c0c0" and "ffffff".
random-dark
random-light
Please visit the project's homepage at https://metacpan.org/release/App-sshwrap-hostcolor.
Source repository is at https://github.com/perlancar/perl-App-sshwrap-hostcolor.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=App-sshwrap-hostcolor
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
ssh
perlancar <perlancar@cpan.org>
This software is copyright (c) 2018 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install App::sshwrap::hostcolor, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::sshwrap::hostcolor
CPAN shell
perl -MCPAN -e shell install App::sshwrap::hostcolor
For more information on module installation, please visit the detailed CPAN module installation guide.