How is input / input encoded in a string sent to the SSH shell entered?

I am making an SSH client for a special device that does not have a return key on it, my question is, how is the return key encoded in a string sent to the shell? is it just "\ n"?

+5
source share
1 answer

Then the key Entersends the character 13 = \ 015 = 0x0d = \ r = ^ M = CR ( carriage return ). You may notice that by typing Ctrl+ V, then Enterin the terminal: Ctrl+ Vtells the shell to insert the next character literally instead of interpreting it as a command.

stty, . .

, Enter , , : 10 =\012 = 0x0a =\n = ^ J = LF (line feed).

+3

All Articles