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

Integrated terminal unlimited buffer #14320

Closed
wilrnh opened this issue Oct 24, 2016 · 8 comments
Closed

Integrated terminal unlimited buffer #14320

wilrnh opened this issue Oct 24, 2016 · 8 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) terminal General terminal issues that don't fall under another label

Comments

@wilrnh
Copy link

wilrnh commented Oct 24, 2016

  • VSCode Version: 1.6.1
  • OS Version: OSX 10.11.6

Steps to Reproduce:

  1. Run command in terminal that continuously spits output
  2. Monitor memory usage with Activity Monitor

It seems as if, at least by default, vscode's integrated terminal has an unlimited buffer. Is this by design, or is there a way to limit this somehow?

@wilrnh
Copy link
Author

wilrnh commented Oct 24, 2016

Looks like this is a setting in Terminal.app. Close this issue if this is the case. I'll go ahead and try this out.

@Tyriar
Copy link
Member

Tyriar commented Oct 24, 2016

I believe the buffer is capped at 1000 lines, are you sure you're seeing more than that?

@Tyriar Tyriar added info-needed Issue requires more information from poster terminal General terminal issues that don't fall under another label labels Oct 24, 2016
@marcusball
Copy link

marcusball commented Oct 24, 2016

On Windows (Code 1.6.1; Windows 10 14393.321), during my application debugging, I occasionally accidentally put a print statement in an infinite loop. This spams the output window, and Code immediately becomes very unresponsive. If I click the garbage can icon to delete the output console, Code will take a minute or two before the delete is handled and the console is closed; only after this does everything become responsive again.

At this point, terminating the Code process forcefully is easier than trying to recover from the buffer getting filled.

@wilrnh
Copy link
Author

wilrnh commented Oct 25, 2016

@Tyriar I definitely got more than that into the buffer. I'm pretty convinced that the terminal app that vscode launches for the integrated terminal is responsible. I previously had Terminal.app using up as much memory as possible for the buffer, which is what I think causes the system impact when sending too much output to the terminal. Now, I have Terminal.app capped at 10k lines which seems to keep things running smoothly for now. I'd close this as a non-issue unless you want to document this in settings.json. I already have an answer on stackoverflow: http://stackoverflow.com/questions/39881395/visual-studio-code-scroll-back-buffer/

@wilrnh
Copy link
Author

wilrnh commented Oct 25, 2016

@marcusball I believe cmd.exe has a scrollback limit setting as well.

@Tyriar
Copy link
Member

Tyriar commented Oct 25, 2016

@marcusball see xtermjs/xterm.js#280 for that, that's not the buffer but issues with the rendering.

@wilrnh I don't think the answer to the question is correct, VS Code does not touch xterm or Terminal.app, it launches bash and then communicates with xterm.js (an xterm emulator for the web). I would expect the scrollback setting in xterm.js to override any shell's scrollback, as that's the thing that holds onto the data: https://github.com/sourcelair/xterm.js/blob/269540bfedc9fc4b160d75d15e54a2e07854f7e5/src/xterm.js#L340

I've certainly hit the 1000 line limit on Linux as it's frustratingly small for me sometimes. I think you're also seeing the performance issues with xterm.js, unrelated to scrollback xtermjs/xterm.js#280 xtermjs/xterm.js#150 xtermjs/xterm.js#134 - the issues here are to do with how the text is rendered and how the scrolling is implemented.

Let me know if you think I'm wrong but I'm going to close this in favor of #11805

@Tyriar Tyriar closed this as completed Oct 25, 2016
@Tyriar Tyriar added *duplicate Issue identified as a duplicate of another issue(s) and removed info-needed Issue requires more information from poster labels Oct 25, 2016
@wilrnh
Copy link
Author

wilrnh commented Oct 25, 2016

I think you're right. I think "terminal.external.osxExec": "Terminal.app", probably confused me. Its obviously for the external, not internal terminal.

I'm not convinced the scrollback settings in Terminal.app settings are insignificant here though. I just switched it back on to full (make full use of memory) and I can definitely see the memory starting to jump on my machine. However like you said this could be due to some other unrelated issue than scrollback buffer lengths eg rendering or even something in my local system configuration.

One thing I didn't mention is that i'm using tmux and oh-my-zsh. Not sure if thats relevant.

@Tyriar
Copy link
Member

Tyriar commented Oct 26, 2016

Yes I expect the memory to go nuts due to garbage collection being defered when it's creating and throwing out so many HTMLElements.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
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) terminal General terminal issues that don't fall under another label
Projects
None yet
Development

No branches or pull requests

3 participants