1

I want to be able to configure a screen session through screenrc or within a session to behave just like an xterm terminal. Currently I have a c# app that uses ssh.net libraries to ssh to a Linux box from a windows machine where I attach to a screen session and send commands and receive responses back. I see two different kind and responses for the same command if I am attached to a screen session compare to when I am not attached to a screen session. To demonstrate the problem I will duplicate the issue using a putty terminal and log the data.

  1. Open a putty terminal from windows
  2. Change the Session->Logging setting and select SSH Packets, also browse to a location to save the putty.log file
  3. Set your IP address and connect to a Linux machine
  4. Once logged in, issue the following command printf "abc\6\n", this string contains an ack character
  5. The response will print abc and of course it would not show the \6 since it is not a printable character
  6. Open putty.log file and you will see the response packets data contains \6 which is the correct behavior.
  7. Now create a session by issuing the following command: screen -dmS test
  8. Attach to the session by issuing the following command: screen -Rr test
  9. issue the following command again printf "abc\6\n"
  10. abc will be printed as expected, but if you look at response packets data in putty.log it won't have the \6 character anymore
  11. I can solve this issue by piping the command like this printf "abc\6\n" | cat -v to convert \6 to printable form and show ^F on the screen, I would rather receive \6 in my packets data and this is not a desirable solution but at least it provides a solution to my problem.

The following is a more serious issue that I haven't been able to resolve. To demonstrate please do the following:

  1. Open a putty terminal from windows

  2. Change the Session->Logging setting and select SSH Packets and also browse to a location to save the putty.log file

  3. Set your IP address and connect to a Linux machine

  4. Once logged in, Change the stty setting by issuing the following command (tells the terminal to not replace the new line by carriage return): stty -onlcr

  5. Then issue the command ls -al

  6. The putty.log file will contain the correct set of data with no extra characters.

  7. Now create a session by issuing the following command: screen -dmS test

  8. Attach to the session by issuing the following command: screen -Rr test

  9. issue the following command again stty -onlcr

  10. issue ls -al again

  11. if you look at response packet data in putty.log you will see that after a certain number of packets received the response will contain extra characters in front of each response. the extra characters are in the following format [13C. the numbers between [ and C varies. I believe they indicate the column location of each response. The terminal display of a screen session is identical to an xterm session however the packet data in case of xterm does not have the column location data which screen has. I am trying to get rid of those column location packet data that screen generates and xterm doesn't.

    I would like to make my responses packet data to behave the same way as an standard xterm terminal, Why is there a difference and is there a way to configure the screen to get responses consistent with a xterm type of terminal.