Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terminal output is truncated #75139

Closed
sguillia opened this issue Jun 8, 2019 · 1 comment
Closed

Terminal output is truncated #75139

sguillia opened this issue Jun 8, 2019 · 1 comment
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s)

Comments

@sguillia
Copy link

sguillia commented Jun 8, 2019

Issue Type: Bug

Please have a look at this screenshot
Screenshot from 2019-06-08 17-25-13

The program is supposed to print a lot of lines (all letter combinations from a to z).

Bug: The terminal output gets truncated randomly, about one time out of five.

4 times out of 5, there is no problem, I can see the last line, in this case the one with z z z.

Here is another screenshot.

Screenshot from 2019-06-08 17-33-05

I added this in tasks.json so it is normal not to have the Terminal will be reused by tasks, press any key to close it. at the end.

    "presentation": {
        "showReuseMessage": false
    }

To prove it is a display or buffering problem, and not my task getting stopped, I have changed the code so that it writes text to a file at the very end of the program.

When I took the screenshot, the file tmp/vscode-bug-demo.txt existed and had the text inside it.

Here is the content of tasks.json:

{
	// See https://go.microsoft.com/fwlink/?LinkId=733558
	// for the documentation about the tasks.json format
	"version": "2.0.0",
	"tasks": [
		{
			"label": "Bug demo",
			"type": "shell",
			"command": "python3 print-a-lot-of-lines.py",
			"group": {
				"kind": "build",
				"isDefault": true
			}
		}
	],
    "presentation": {
        "showReuseMessage": false
    }
}

(btw your template is not a valid JSON file because of the comments)

Here is the Python 3 code if you want to try to reproduce:

#!/usr/bin/python3

for x in range(ord('a'), ord('z')+1):
	for y in range(ord('a'), ord('z')+1):
		for z in range(ord('a'), ord('z')+1):
			print("Bad combination: " + chr(x) + ' ' + chr(y) + ' ' + chr(z))

# Prove that the task has not been interrupted 
with open("/tmp/vscode-bug-demo.txt", "a") as myfile:
    myfile.write("Task has run until the end")

I have another program in Go, that does the same thing (printing all combinations of three letters from a to z). The terminal output is truncated most of the time which makes the terminal output, and consequently the task system, useless. I wrote the python example in order to reproduce the bug with a simple program.

Steps to Reproduce:

  1. Have a program that prints a lot of lines (17576 in my case and if often stops near the end)
  2. Have a task so that the program output goes in Terminal output
  3. Play the build shortcut several times (wait until previous task is done before launching again)
  4. Observe as the terminal output gets truncated

VS Code version: Code 1.35.0 (553cfb2, 2019-06-04T01:13:26.790Z)
OS version: Linux x64 4.15.0-51-generic

System Info
Item Value
CPUs Intel(R) Core(TM) i5-8300H CPU @ 2.30GHz (8 x 3900)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: disabled_software
surface_synchronization: enabled_on
video_decode: unavailable_off
webgl: enabled
webgl2: enabled
Load (avg) 1, 1, 1
Memory (System) 7.64GB (2.64GB free)
Process Argv --unity-launch
Screen Reader no
VM 0%
Extensions: none
@Tyriar
Copy link
Member

Tyriar commented Jul 6, 2019

/duplicate #38137

@Tyriar Tyriar closed this as completed Jul 6, 2019
@vscodebot vscodebot bot added the *duplicate Issue identified as a duplicate of another issue(s) label Jul 6, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Aug 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

2 participants