2 ms·
I have two functions I use to switch between color and no color. One function also fixes the terminal if I read binary by mistake. I guess I could call them c
by LinuxBender 7y ago
I have two functions I use to switch between color and no color. One function also fixes the terminal if I read binary by mistake. I guess I could call them color and nocolor. Edit as required. There's probably a better way to do this. Old habits and such.
function sane()
{
LANG="C";LC_ALL="C";LC_CTYPE="C";export LANG LC_ALL LC_CTYPE;
S_TIME_FORMAT=ISO;export S_TIME_FORMAT;
TERM=vt102;export TERM;
unset IFS;
stty sane;
tput rs1;
echo -e "\033c";
reset;
clear;
set -o posix;
}
function utf()
{
LANG="en_US.UTF-8";LC_ALL="en_US.UTF-8"; LC_CTYPE="en_US.UTF-8";export LANG LC_ALL LC_CTYPE
TERM=xterm;export TERM
}