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

No response for Report Cursor Position command #2107

Closed
seldomU opened this issue May 21, 2019 · 2 comments · Fixed by #2109
Closed

No response for Report Cursor Position command #2107

seldomU opened this issue May 21, 2019 · 2 comments · Fixed by #2109
Assignees
Labels
area/parser important type/bug Something is misbehaving
Milestone

Comments

@seldomU
Copy link

seldomU commented May 21, 2019

I'm trying to get the terminal's cursor position like this:

   term.on("data", console.log );
   term.write(`\u001B[6n`);

The data event does not fire. InputHandler's onData event fires, but has no listeners. Should I subscribe to that event as well?
When I send \u001B[n (sendDeviceAttributes) instead, the Terminal's data event does fire.
xterm version is 3.13.0

@Tyriar
Copy link
Member

Tyriar commented May 21, 2019

xterm.js/src/InputHandler.ts

Lines 1765 to 1770 in 739723f

case 6:
// cursor position
const y = this._terminal.buffer.y + 1;
const x = this._terminal.buffer.x + 1;
this._onData.fire(`${C0.ESC}[${y};${x}R`);
break;

I think we might be missing hooking up the data event from InputHandler to Terminal:

xterm.js/src/Terminal.ts

Lines 353 to 356 in 739723f

this._inputHandler = new InputHandler(this);
this._inputHandler.onCursorMove(() => this._onCursorMove.fire());
this._inputHandler.onLineFeed(() => this._onLineFeed.fire());
this.register(this._inputHandler);

@Tyriar Tyriar added this to the 3.14.0 milestone May 21, 2019
@Tyriar Tyriar self-assigned this May 21, 2019
@Tyriar Tyriar added area/parser important type/bug Something is misbehaving labels May 21, 2019
@Tyriar Tyriar modified the milestones: 3.14.0, 3.13.2 May 21, 2019
@Tyriar
Copy link
Member

Tyriar commented May 21, 2019

I need to test but if that is the problem we should do a patch release.

Tyriar added a commit to Tyriar/xterm.js that referenced this issue May 21, 2019
Tyriar added a commit that referenced this issue May 21, 2019
Tyriar added a commit that referenced this issue May 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/parser important type/bug Something is misbehaving
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants