zowe-cli
zowe-cli copied to clipboard
CommandResponse never empties stderr and stdout buffers
As the name of this issue indicates, the stdout
and stderr
buffers in CommandResponse
are never emptied when data is written to the console. This underlying issue was the cause of the issue fixed in zowe/imperative#573, but more consideration needs to be put into this behavior.
Possible Resolutions and Problems:
- Print buffers on
write()
and reallocate the buffers- Prints data that might come from
silent
command handlers - Breaks tests that check
buildJsonResponse
'sstderr
andstdout
- Prints data that might come from
- Implement 1 and don't add anything from a
silent
command handler to the buffers- Again breaks tests that check
buildJsonResponse
'sstderr
andstdout
to verify the information was silently added to the buffer - May hide important
stderr
information from the end user or automation
- Again breaks tests that check
- Implement new silent
stdout
andstderr
buffers that appear inbuildJsonResponse
- Events will be out of order on output
Other considerations appreciated. However, any change to this low level code could possibly be considered breaking to plugins and extenders, so changes would likely need to be implemented in next