I am using golang ssh package to build a ssh client, I set the terminal modes as below
// Set up terminal modes
modes := ssh.TerminalModes{
ssh.ECHO: 0, // disable echoing
ssh.TTY_OP_ISPEED: 14400, // input speed = 14.4kbaud
ssh.TTY_OP_OSPEED: 14400, // output speed = 14.4kbaud
}
// Request pseudo terminal
if err := session.RequestPty("xterm", 80, 40, modes); err != nil {
log.Fatalf("request for pseudo terminal failed: %s", err)
}
it works fine, but a tiny problem, when I use "ls" command, it returns the names with color code, like below
[root@localhost ~]# ls
ls
anaconda-ks.cfg [0m[01;34mpeter[0m
[01;32mbuild.sh[0m [01;34mredis64[0m
it makes me feel difficult to read the file names, so is there any method to remove the color code around the names? thanks