You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
\r instructs the terminal to do a carriage return. The only way to get it printed in the input is to escape the \ before printing it. I.e. before feeding data to the stream you could do data.replace("\r", "\\r").
this is my debug code
`
buf = os.read(self.input.fileno(), 4096)
LOG.info(repr(buf))
`
when I send whoami by xshell's command bar
the buf's log is
[process_stdin():76] [PID:33553 TID:140554967484224] 'whoami\r'
Screen.buffer's log is
'[root@fortress-test-169fb0752 ~]#' .
If I just use the shell, input whoami
the buf's log is
[process_stdin():76] [PID:66022 TID:139634374461248] 'w'
[process_stdin():76] [PID:66022 TID:139634374461248] 'h'
[process_stdin():76] [PID:66022 TID:139634374461248] 'o'
[process_stdin():76] [PID:66022 TID:139634374461248] 'a'
[process_stdin():76] [PID:66022 TID:139634374461248] 'm'
[process_stdin():76] [PID:66022 TID:139634374461248] 'i'
[process_stdin():76] [PID:66022 TID:139634374461248] '\r'
Screen.buffer's log is
'[root@fortress-test-169fb0752 ~]# whoami'
So, how can I get the input contains '\r'?
The text was updated successfully, but these errors were encountered: