SSH File Server Doesn't default to a sane terminal width if a 0 width terminal is requested

0 votes
asked May 7 by walljm (470 points)

The issue is in the pty-req handling in FileServer/Ssh/Channel.cs around line 618.

When a 0 width terminal is requested, Rebex just sends a new line after every character. Here is the code with my fix below:

...
if (_columns == 0)
{
    _columns = 80;
}
...

1 Answer

0 votes
answered May 7 by Lukas Pokorny (111,390 points)

Thanks for catching and reporting this! I would guess that even very short values might lead to all kinds of strange issues, so we'll see how common SSH servers behave and try to follow the common approach. But using a default value such as 80 instead of 0 looks like a good idea.

(However, please don't post parts of Rebex source code on public forums.)

commented May 7 by walljm (470 points)
ah, roger that.  thanks!
commented May 26 by Lukas Pokorny (111,390 points)
Our latest release, 2020 R2, attempts to fix this issue by rejecting requests with wrong values. We hope this would be a better solution that defaulting to a fixed number of columns or rows. However, if you encounter any problem with that solution, please let us know.
...