Hi, I have no issues when using SshCommand.Execute(). However, when I create a ShellStream and attach to a StreamReader object, when I submit commands I tend to get garbled output like so:
perl -e "use LWP::Simple; my @info = head(\"https://files.example.\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\bfo = head(\"https://
..... snip
That is, the stream output is littered with backspaces, and the number of backspaces sometimes but don't necessarily match the number of corrections I'd expect. On the same output later, there is a case where I see X backspace characters and there truly are X "corrected" characters.
Example above: that's 64 backspace characters, but you can see that it only seems to back up 32 characters before starting from ... "fo = head" again.
Anyone have an idea about either of these?
1. Why is it doing this "correcting" at all?
2. Why don't the number of backspaces match the number of corrected characters?
Thanks much for insight anyone can provide.
P.S. I find that increasing the number of "columns" when I invoke CreateShellStream() takes care of this. I've increased from 80 columns to 1000, or even 10000, and I don't see backspaces. Anyone have thoughts about an appropriate value? Risk associated with large number of "columns"?
Comments: ** Comment from web user: washirv **
perl -e "use LWP::Simple; my @info = head(\"https://files.example.\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\bfo = head(\"https://
..... snip
That is, the stream output is littered with backspaces, and the number of backspaces sometimes but don't necessarily match the number of corrections I'd expect. On the same output later, there is a case where I see X backspace characters and there truly are X "corrected" characters.
Example above: that's 64 backspace characters, but you can see that it only seems to back up 32 characters before starting from ... "fo = head" again.
Anyone have an idea about either of these?
1. Why is it doing this "correcting" at all?
2. Why don't the number of backspaces match the number of corrected characters?
Thanks much for insight anyone can provide.
P.S. I find that increasing the number of "columns" when I invoke CreateShellStream() takes care of this. I've increased from 80 columns to 1000, or even 10000, and I don't see backspaces. Anyone have thoughts about an appropriate value? Risk associated with large number of "columns"?
Comments: ** Comment from web user: washirv **
It's not 100% consistent. I just saw it again where the stream output contained instances of " \b" (whitespace followed by backspace).
One other thing -- I run commands like so:
1. Send command plus newline
2. Read response
3. Expect prompt (e.g. $, although I'm setting my own "unique" prompt to make it easy to find EOF-equivalent)
The response always contains an echo of the command I sent, the output of the command, and the prompt -- all three are expected.
But it always seems to be the command echo that contains the backspace weirdness. I'll try to paste a stub reproduction of instantiating the shell and stream, plus sample command with backspace oddities, when I get a chance.