【发布时间】:2021-09-08 17:44:58
【问题描述】:
我正在编写一个 ssh 服务器,当我在 ssh.Channel 上运行 fmt.Fprintln 时,它会显示例如:
帮助
Commands:
clear clear the screen
exit exit the program
help display help
打印线型不是预期的
我的代码:
func handleShells(channel ssh.Channel, sshConn *ssh.ServerConn, reg map[string]interface{}) {
defer channel.Close()
fmt.Fprintln(channel, ">>help")
fmt.Fprintln(channel, "Commands:")
fmt.Fprintln(channel, " clear clear the screen")
}
还有其他方法可以解决这个问题吗? 非常感谢提前
【问题讨论】: