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

Wrong restore a cursor position in Midnight Commander #229

Closed
meefik opened this issue Aug 14, 2016 · 9 comments
Closed

Wrong restore a cursor position in Midnight Commander #229

meefik opened this issue Aug 14, 2016 · 9 comments
Milestone

Comments

@meefik
Copy link
Contributor

meefik commented Aug 14, 2016

Midnight Commander send two command for save a cursor positon:

  1. ESC 7 (DECSC)
    https://github.com/sourcelair/xterm.js/blob/b32a34b97c71539d86c5df5871b40397dc04fcf0/src/xterm.js#L2052
    xterm.js received a position X and Y correctly.
  2. CSI s (ANSI.SYS)
    https://github.com/sourcelair/xterm.js/blob/b32a34b97c71539d86c5df5871b40397dc04fcf0/src/xterm.js#L2430
    xterm.js received a position X and Y always 0.

Details

  • Browser and browser version: Google Chrome 52.0.2743.116 (64-bit)
  • OS version: Debian 8
  • xterm.js version: b32a34b

Steps to reproduce

  1. Run demo app.
  2. Execute command mc.
  3. Exit from mc.
  4. Cursor restored always x:0, y:0.
@parisk
Copy link
Contributor

parisk commented Aug 17, 2016

Are there any chances that this got fixed after #231?

@meefik
Copy link
Contributor Author

meefik commented Aug 17, 2016

@Santinell
Copy link

Santinell commented Sep 30, 2016

I have the same problem, but meefik's workaround don't work for me...

Details

Browser and browser version: Chrome 53.0
OS version: Ubuntu 16.04
xterm.js version: 220828f

@Santinell
Copy link

Santinell commented Sep 30, 2016

@AndrienkoAleksandr
Copy link
Contributor

AndrienkoAleksandr commented Feb 15, 2017

This bug depends on Midnight Commander version. For example for MC 4.8.15 this bug is reproducible; mc 4.8.18 - works without this issue.

@AndrienkoAleksandr
Copy link
Contributor

@parisk #231 didn't fix this issue, because this is bug of the text user interface parser(we need improve this parser - InputHandler.ts).

@Tyriar
Copy link
Member

Tyriar commented Feb 15, 2017

If this only repros in an older version of MC then they probably fixed the issue on their end? The logic for save and restore cursors seems pretty foolproof to me:

  /**
   * CSI s
   *   Save cursor (ANSI.SYS).
   */
  public saveCursor(params: number[]): void {
    this._terminal.savedX = this._terminal.x;
    this._terminal.savedY = this._terminal.y;
  }


  /**
   * CSI u
   *   Restore cursor (ANSI.SYS).
   */
  public restoreCursor(params: number[]): void {
    this._terminal.x = this._terminal.savedX || 0;
    this._terminal.y = this._terminal.savedY || 0;
  }

@Santinell
Copy link

Unfortunately in Ubuntu 16.04 you can install only 4.8.15 from official repos.
For Ubuntu 14.04 version of MC is much older I think

@Tyriar
Copy link
Member

Tyriar commented Jul 4, 2017

Fixed in #728

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants