I was able to create a Windows Command Prompt that automatically changes its text color on a white background every ~1.5 seconds, thanks to the help of @dbenham and @Woody. I also use PuTTY every day, almost more than Windows Command Prompt, so for fun I would also like to figure out how to do the same thing in PuTTY, no matter which server I connect to (therefore, hopefully there's a way for auto-change-text-color.bat to be read locally instead of having to be put it on whatever server I connect to). All the servers I connect to are Linux distributions via SSH.
My Windows Command Prompt solution is here: https://superuser.com/a/700041/210421 (And here's a quick GIF I made to show what it's doing: http://i.minus.com/iZC4WapYtRVad.gif)
Is there a way to do this via PuTTY with Linux? Could I make a (possibly modified) version of this batch file, or maybe a perl script run in the background of every PuTTY session I open up? I have 10 saved SSH connections, and many more will be added in the future. So if there is a way to make PuTTY find the color-changing .bat file locally instead of having to put the file on every server, that would be very convenient. A solution where I have to place it on every server would also be helpful if that is the only way.
If not with PuTTY, maybe with another common SSH client?
Thank you for any help!
The Windows solution is also quoted here:
I ended up using this as my auto-change-text-color.bat command, because I ended up wanting just the text to change, and got rid of some colors that didn't look well with a white background:
@echo off
:loop
set NUM=1 2 3 4 5 6 8 9 A B C D
for %%x in (%NUM%) do (
color F%%x
>nul ping localhost -n 4
)
goto loop
As for my Windows Command Prompt shortcut, it starts in my development directory, and the "Target" is:
%COMSPEC% /t:F9 /s /k cd scripts && start /b %COMSPEC% /c auto-change-text-color.bat <nul && cd .. && env
It opens up in my development environment's script directory, runs the color changing script in the background that is stored in my scripts folder, then goes back to the parent folder and runs another batch file setting all my environment variables. It's perfect.
timeout /t 2 >nul
in its place. And pray tell, why do you do this at all? Too much free time?