我有一个连接到远程终端的开放套接字。使用“Force telnet client into character mode”的答案,我能够将该终端置于字符模式。
我的问题是,如何使用这种方法隐藏远程终端中的光标?
最佳答案
为了扩展 mjh2007 的答案,下面的 c/c++ 代码将实现向终端发送转义码,并且比原始的十六进制数字更具可读性。
void showCursor(bool show) const {
#define CSI "\e["
if (show) {
fputs(CSI "?25h", stdout);
}
else {
fputs(CSI "?25l", stdout);
}
#undef CSI
}
关于c - 在远程终端上隐藏光标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2649733/