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

ITerminalInstance.onData should be higher level #18453

Closed
dbaeumer opened this issue Jan 12, 2017 · 8 comments
Closed

ITerminalInstance.onData should be higher level #18453

dbaeumer opened this issue Jan 12, 2017 · 8 comments
Assignees
Labels
terminal Integrated terminal issues

Comments

@dbaeumer
Copy link
Member

  • VSCode Version: 1.9.x

The callback trigger on ITerminalInstance.onData() receives a string containing the raw pty output including the ANSI Control characters. Although this might be useful for some clients I think the majority is not interested in ANSI Control characters since the interpretation is not easy. I therefore suggest that the terminal provide two different listeners. One raw listener that includes the data like it is today and one line based listener that fires if

  1. a line got added to the output
  2. when a line got changed.

The event should contain the line number as well.

@dbaeumer dbaeumer added terminal Integrated terminal issues api labels Jan 12, 2017
@dbaeumer dbaeumer changed the title ITerminal.onData should be high level ITerminalInstance.onData should be higher level Jan 12, 2017
@Tyriar
Copy link
Member

Tyriar commented Jan 12, 2017

Oh I thought you mentioned you wanted to include escape sequences? You just want line by line data with escape sequences stripped then?

Line number is not an easy thing to convey as the buffer continually gets trimmed to adhere to the terminal's scrollback.

@dbaeumer
Copy link
Member Author

Yes, line by line with escape sequence stripped would be perfect. I don't necessarily need a line number a sort of line ID would help as well to determine if a line has changed in regards to a previous line. That would allow to determine if an computed problem needs to be invalidated.

@Tyriar
Copy link
Member

Tyriar commented Jan 27, 2017

@dbaeumer RE line ID: Does this line rewriting happen with any compilers/linters you know? In my experience they typically just print new lines.

@dbaeumer
Copy link
Member Author

@Tyriar agree that they typically print new lines. But if not there is no way for the matcher to detect this if we don't have some sort of id.

@Tyriar
Copy link
Member

Tyriar commented Mar 1, 2017

The current solution is working fine for now so closing this off.

@Tyriar Tyriar closed this as completed Mar 1, 2017
@Tyriar Tyriar removed this from the March 2017 milestone Mar 1, 2017
@BartNetJS
Copy link

@Tyriar I try to use the terminal.onData(data => ...) in an extension
But the vscode.d.ts Terminal Interface does not have the onData declaration
I'm using VSCode 1.19.0-insider
And in the package.json for the extension:

"engines": {
"vscode": "^1.19.0"
}

"dependencies": {
"vscode": "^1.1.7",
"vscode-languageclient": "^3.5.0"
}

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
@Tyriar
Copy link
Member

Tyriar commented Nov 17, 2017

@BartNetJS this is an internal API so it's not available to extensions. We're not sure currently whether we want to expose this to extensions as there are security and performance considerations to take into account.

@Tyriar Tyriar removed the api label Nov 17, 2017
@Tyriar
Copy link
Member

Tyriar commented Nov 17, 2017

Not sure why this was locked but #13337 might be what you're after.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
terminal Integrated terminal issues
Projects
None yet
Development

No branches or pull requests

3 participants