vscode-code-runner icon indicating copy to clipboard operation
vscode-code-runner copied to clipboard

Is there a reason for the trailing newline in the Output panel?

Open wjandrea opened this issue 2 years ago • 1 comments

Why add a trailing newline after the Code Runner footer? It just seems to take up space. For example, if the contents of the Output panel overflow, the blank line will always be shown and never the first line. That's OK if it's just the Code Runner header that's hidden, but if I need to make sure I didn't miss any output from my code, then I need to scroll up or resize the panel.

Screenshot showing some output covered up

So why don't we get rid of the extra blank line?


Here's the code that does it:

https://github.com/formulahendry/vscode-code-runner/blob/de0dc89a442b37c4f90cdb66d7ad4bf8da949564/src/codeManager.ts#L493


BTW, Code Runner also adds a trailing newline after the command output, which I'm totally fine with. That makes sense in case the command didn't add a trailing newline itself.

wjandrea avatar Aug 02 '22 23:08 wjandrea

After some more experience, it looks like the newline helps separate consecutive outputs if you have "Clear Previous Output" enabled (code-runner.clearPreviousOutput). But of course, if that's disabled, it's pointless.

wjandrea avatar Aug 17 '22 06:08 wjandrea