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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use IBufferService for buffer access in InputHandler #2304

Merged
merged 9 commits into from Jul 13, 2019

Conversation

Tyriar
Copy link
Member

@Tyriar Tyriar commented Jul 13, 2019

Also adds the new logLevel option.

Part of #1507
Fixes #1560

@jerch a quick once over of the non-test files would be good 馃槂

@Tyriar Tyriar added this to the 4.0.0 milestone Jul 13, 2019
@Tyriar Tyriar requested a review from jerch July 13, 2019 07:53
@Tyriar Tyriar self-assigned this Jul 13, 2019
Copy link
Member

@jerch jerch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one third less _terminal refs 馃憤

Seems cleaning up InputHandler will take some more iterations, we still have over 250 refs there (mostly .updateRange and cols/rows access). Most of the basic flags could go into CoreService I guess? Also the mouse flags - seems we maintain like 50 separate flags here...

@@ -41,7 +41,10 @@ const GLEVEL: {[key: string]: number} = {'(': 0, ')': 1, '*': 2, '+': 3, '-': 1,
class DECRQSS implements IDcsHandler {
private _data: Uint32Array = new Uint32Array(0);

constructor(private _terminal: any) { }
constructor(
private _terminal: any,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Saw that this comes from me, wonder why I typed it as any in the first place. 馃

Imho DECRQSS can be fixed and (terminal removed) in a separate issue later on when we have all the needed services. Also the SGR sub command does not yet do the right thing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was actually broken as it was using the now removed handler 馃槺

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed terminal usage from it completely, pretty easy

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lol missing test cases, tsss. Good you spotted it 馃憤

@Tyriar
Copy link
Member Author

Tyriar commented Jul 13, 2019

updateRange should probably live in render service. I'll include cols/rows in this as well as they live on buffer service too.

@Tyriar
Copy link
Member Author

Tyriar commented Jul 13, 2019

Also added a log service and added the logLevel option to fix #1560

@Tyriar Tyriar force-pushed the inputhandler_bufferservice branch from 47b004a to 4600259 Compare July 13, 2019 17:11
Copy link
Member

@jerch jerch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay - InputHandler is almost "terminal free", only 157 refs to go (from over 300 or so).

addons/xterm-addon-webgl/src/WebglUtils.ts Show resolved Hide resolved
demo/client.ts Show resolved Hide resolved
src/InputHandler.ts Show resolved Hide resolved
@@ -87,7 +88,6 @@ export class Terminal extends Disposable implements ITerminal, IDisposable, IInp
* The HTMLElement that the terminal is created in, set by Terminal.open.
*/
private _parent: HTMLElement;
private _context: Window;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay, window gone. Still need to get rid of the line above (and several lines below, too) 馃樃

src/common/services/LogService.ts Show resolved Hide resolved
@Tyriar Tyriar merged commit 4d9d6fb into xtermjs:master Jul 13, 2019
@Tyriar Tyriar deleted the inputhandler_bufferservice branch July 13, 2019 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make "debug mode" public API
3 participants