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

Convert xterm.js to TypeScript #839

Merged
merged 23 commits into from
Aug 6, 2017
Merged

Convert xterm.js to TypeScript #839

merged 23 commits into from
Aug 6, 2017

Conversation

Tyriar
Copy link
Member

@Tyriar Tyriar commented Aug 5, 2017

Finally it's happening 😄. There was quite a bit of code/variables removed while doing this.

Fixes #335

Major changes:

  • xterm.js -> Terminal.ts
  • Removed a bunch of dead code
  • Lots of types added
  • Added one-variable-per-declaration tslint rule
  • Typed InputHandler._terminal as an IInputHandlingTerminal which keeps all of InputHandler's need in that interface, without messing with ITerminal.

Cool little feature I added with the types: strongly typing the strings for getOption/setOption:

image


  • Add more types
  • Ensure reset still works
  • Review TODOs

Tyriar added 6 commits August 5, 2017 00:22
Multiple declarations per line makes it more difficult to read what
exactly is declared and generally makes code more verbose and less
likely to fill in types
@Tyriar Tyriar added the work-in-progress Do not merge label Aug 5, 2017
@Tyriar Tyriar added this to the 3.0.0 milestone Aug 5, 2017
@Tyriar Tyriar self-assigned this Aug 5, 2017
@coveralls
Copy link

coveralls commented Aug 5, 2017

Coverage Status

Coverage decreased (-0.5%) to 69.987% when pulling e6b431d on Tyriar:335_xterm_to_ts into f5ba386 on sourcelair:v3.

@coveralls
Copy link

coveralls commented Aug 5, 2017

Coverage Status

Coverage decreased (-0.5%) to 69.987% when pulling 0b5ff47 on Tyriar:335_xterm_to_ts into f5ba386 on sourcelair:v3.

@coveralls
Copy link

coveralls commented Aug 5, 2017

Coverage Status

Coverage decreased (-0.5%) to 70.006% when pulling 8a0bcf6 on Tyriar:335_xterm_to_ts into f5ba386 on sourcelair:v3.

Tyriar added 7 commits August 5, 2017 12:57
This brings in proper support to resize both buffers (xtermjs#510) and fixes an
exception that was caused by wrongfully not clearing the normal buffer when
resizing while the alt buffer is active.

There was an obscure bug in this that could have caused some great confusion
later on; When switching to the alt buffer, a hard terminal reset was performed
which tried to retain the buffers. However, because buffers was initialized in
the Terminal constructor to a new BufferSet, the Terminal.buffer convenience
pointer was pointing at a stale alt buffer which was the one actually being
used, not Terminal.buffers.alt.

Fixes xtermjs#842
Fixes xtermjs#510
The alt buffer is now cleared immediated after activating the normal buffer and
is filled when switching to it. The tests were failing because the alt buffer
wasn't being cleared properly with the previous solution.
setOption('scrollback', 0) no longer returns false, it just warns.
@Tyriar
Copy link
Member Author

Tyriar commented Aug 6, 2017

I pulled #843 into this for the v3 branch while it's still fresh in my head.

@coveralls
Copy link

coveralls commented Aug 6, 2017

Coverage Status

Coverage increased (+0.9%) to 71.429% when pulling 56ec6ed on Tyriar:335_xterm_to_ts into f5ba386 on sourcelair:v3.

@coveralls
Copy link

coveralls commented Aug 6, 2017

Coverage Status

Coverage increased (+0.9%) to 71.429% when pulling 2878d97 on Tyriar:335_xterm_to_ts into f5ba386 on sourcelair:v3.

@coveralls
Copy link

coveralls commented Aug 6, 2017

Coverage Status

Coverage increased (+0.9%) to 71.429% when pulling ae3169e on Tyriar:335_xterm_to_ts into f5ba386 on sourcelair:v3.

@coveralls
Copy link

coveralls commented Aug 6, 2017

Coverage Status

Coverage increased (+0.8%) to 71.306% when pulling 6cf2e87 on Tyriar:335_xterm_to_ts into f5ba386 on sourcelair:v3.

@Tyriar Tyriar removed the work-in-progress Do not merge label Aug 6, 2017
@coveralls
Copy link

coveralls commented Aug 6, 2017

Coverage Status

Coverage increased (+0.8%) to 71.306% when pulling 6cf2e87 on Tyriar:335_xterm_to_ts into f5ba386 on sourcelair:v3.

Copy link
Contributor

@parisk parisk left a comment

Choose a reason for hiding this comment

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

Awesome.

Clean and tidy, despite its size 😄!

The code looks great and the demo works great as well.

LGTM 🚀.

@Tyriar Tyriar merged commit 3f5b4f4 into xtermjs:v3 Aug 6, 2017
@Tyriar Tyriar deleted the 335_xterm_to_ts branch August 6, 2017 17:49
@Tyriar Tyriar restored the 335_xterm_to_ts branch August 6, 2017 17:54
@Tyriar Tyriar deleted the 335_xterm_to_ts branch August 6, 2017 18:16
@jens1o
Copy link

jens1o commented Aug 6, 2017

😍 💟

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

Successfully merging this pull request may close these issues.

4 participants