zowe-cli
zowe-cli copied to clipboard
zowe zos-uss issue sshcommand output corrupted if command >76 chars
We are seeing strangely formatted output for the issued command from “zowe zos-uss issue ssh” when command resolves to be >76 chars. e.g. when piping the output from the following 2 WebSphere Liberty for z/OS commands to a file:
- zowe zos-uss issue ssh “server version” --cwd /u/zosconn/openbeta/usr/lpp/IBM/zosconnect/v3r0/wlp/bin
- zowe zos-uss issue ssh “server status zceeob” --cwd /u/zosconn/openbeta/usr/lpp/IBM/zosconnect/v3r0/wlp/bin (See attached bash shell script zowe_zos_uss.sh)
The output to the first command is correctly displayed as the command prompt “$ ” plus the 76 chars of the resolved command: “cd /u/zosconn/openbeta/usr/lpp/IBM/zosconnect/v3r0/wlp/bin && server version” But, the output to the second command (which exceeds 76 chars) includes the prompt “$ ” plus the first 76 chars of the resolved command, then a line with only command prompt, then a line with command prompt followed by the middle of the command, some unprintable chars and finally the end of the command. See attached file zoweZosUssCommandTestOutput.txt.
Attached zip contains example bash script and output file: zoweZosUssCommandTest.zip
Not sure, but maybe Zowe CLI needs to increase size of COLUMNS environment variable before issuing command.
@ChrisPark89 Hi Chris was this something matt and yourself contributed?
Hi, This looks like a known issue with the 'ssh2' node module that is used to make a ssh connection. (See https://github.com/mscdex/ssh2/issues/559) I tested it with my development environment and have the same issue that the user ssh command is truncated, whereas the result of the command seems okay.
$ zowe uss iss ssh "echo abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890"
<uvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890 abcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopqrstuvwxyz1234567890
Thank you for creating a bug report. If you haven't already, please ensure you have provided steps to reproduce it and as much context as possible.
Closing as fixed.