Last question I asked can be found in below link related to the same problem,
How to implement tab completion on the telnet client side
but now as I started implementing taking the inputs from the answers I got, I am facing some more issues. Let me put my code snippet
send(tClntSockFd, "377/375/042/377/373/001", 6, 0));
while(lineIndex < CMD_MAX_LEN) {
/* Receive from the client */
if (RHU_FAILURE == (numbytes = recv(tClntSockFd,usrCommand, CMD_MAX_LEN, 0))) {
RHU_LOG1(RHU_CM_CLI, RHU_LOG_ERROR, "recv error");
exit(1);
}
if('\t' == usrCommand[lineIndex]) {
printf("tab comp req\n");
break;
}
lineIndex++;
}
I know I am not doing it right, but I dont know what is right method, initially I set the telnet into character mode, later I receive characters from the socket, then I am trying handle whenever tab is pressed. The problem is I am not able capture tab, I only get \r and \n at the end.
How to capture tab or any method which would answer my question? Thanks in advance.