Commit Graph
147 Commits
Author SHA1 Message Date
Jörg Breitbart f951abb7a9 wcwidth only for printables 2016-06-24 16:25:00 +02:00
Jörg Breitbart 874ba72f4e wcwidth calculation 2016-06-24 14:16:12 +02:00
Dan Kaplun 323cc44e0e Disable ligatures 2016-06-23 15:07:38 -07:00
Paris 3217a4bee4 Fix cumbersome pasting with Cmd + V
For some reason, setting the element's contentEditable value to true within a keyboard event, while the element has focus, did not allow pasting with clipboard, unless the element gets clicked explicitly.
2016-06-19 06:12:25 +03:00
Paris af7588ef16 On big refreshes remove term.rowContainer instead of term.element from DOM
Fix #120
2016-06-16 11:47:05 +03:00
Paris a6e85ad5f5 Progress with #120 2016-06-16 11:41:41 +03:00
Paris Kasidiaris d5e83902a5 Merge pull request #133 from Tyriar/132_fix_constant_focus
Only refresh when asked
2016-06-15 12:53:31 +03:00
Daniel Imms 0d803ac895 Use CSS animations 2016-06-14 10:52:49 -07:00
Daniel Imms 253babff62 Merge remote-tracking branch 'upstream/master' into 119_fix_cursor_blink 2016-06-14 10:36:56 -07:00
Daniel Imms fac964bcf5 Only refresh when asked
Fixes #132
2016-06-14 10:33:24 -07:00
Paris Kasidiaris 02d809c194 Merge pull request #117 from Tyriar/86_protect_max_refresh
Bound refresh max rows to this.rows not this.lines
2016-06-14 11:11:04 +03:00
Paris Kasidiaris e37a9b62b7 Merge pull request #128 from Tyriar/127_debounce_refresh
Allow refresh to execute 30 times a second maximum
2016-06-14 10:49:53 +03:00
Daniel Imms af29effbf3 Allow refresh to execute 30 times a second maximum
For commands that pass a significant amount of output to the write function,
this prevents the terminal maxing out the CPU and making the UI unresponsive.
While commands can still run beyond what they do on the terminal, it is far
better with a debounce in place as every single terminal manipulation does not
need to be constructed in the DOM.

A side-effect of this is that it makes ^C to interrupt a process seem more
responsive.

Fixes #127
Fixes #126
2016-06-13 12:40:56 -07:00
Paris 57300f5159 Implement addon loader (CommonJS + RequireJS)
Closes #96
2016-06-13 19:07:29 +03:00
Daniel Imms fd5be55d81 Add some jsdoc for important functions
Part of #13
2016-06-10 20:05:26 -07:00
Daniel Imms cb4728f8f5 Tidy up code 2016-06-10 18:05:24 -07:00
Daniel Imms 4a71a41380 Fix cursor blinking when enabled
Fixes #119
2016-06-10 18:05:13 -07:00
Daniel Imms edf897182e Bound refresh max rows to this.rows not this.lines
this.row is the size of rows in the viewport, this.lines is the buffer. It's
only possible to refresh `0` to `this.rows - 1`.

Fixes #86
2016-06-10 13:08:43 -07:00
runarberg b01165c1f8 Fix third level shifts for Mac OS and windows
ISO third level keys were not working. That prevented some inputting
important characters (like pipe `|` and caret `^`) on some keyboard
layouts.

Instead of parsing the user-agent string to find the users os, we now
look into the `platform` attribute of the `navigator` object.

Removed the hijacking of the command key `⌘` on Mac OS as the `Alt` key
on other systems.
2016-06-10 16:14:31 +00:00
Paris 5a56849df8 Stop using binary literals. Non ES6 compatible 2016-06-10 19:02:49 +03:00
Paris fed92ac5c8 Implement tests 2016-06-10 16:35:56 +03:00
Paris 00f4232ecc Export copied text processing to static method 2016-06-10 16:27:58 +03:00
Paris fa1cd89aa9 Fix copying of non-breaking spaces 2016-06-10 16:17:14 +03:00
Daniel Imms 740ae96f5f Merge remote-tracking branch 'upstream/master' into 65_send_ctrl_l_r_key 2016-06-10 03:00:22 -07:00
Paris Kasidiaris 55ca998224 Merge pull request #110 from Tyriar/64_cursor_disappears_when_scrolling
Draw cursor at correct position when scrolling
2016-06-10 12:22:28 +03:00
Paris Kasidiaris fdff1ca793 Merge pull request #107 from runarberg/fix/ctrl-or-shift-insert-copy-pasting
Allow Ctrl/Shift + insert to copy/paste on windows and linux
2016-06-10 11:57:15 +03:00
Daniel Imms eee99f62e1 Improve scroll to work with blank lines after the cursor
This commit works fixes scrolling when there were blank lines after the cursor.
Here is what it does (blank rows are those added by running `clear`):

when increasing rows:
  if there are blank rows below the cursor:
    add a blank row to the bottom
  else if there is room in the buffer above the viewport
    scroll up
  else
    add a blank row to the bottom

when decreasing rows:
  if there are blank rows below the cursor:
    remove a blank row from the bottom
  else
    scroll down

Fixes #111
2016-06-09 21:13:48 -07:00
Daniel Imms da9f86f1a7 Draw cursor at correct position when scrolling
Fixes #64
2016-06-09 19:59:59 -07:00
Daniel Imms 0535f9425b More escape sequence tests 2016-06-09 19:25:29 -07:00
Daniel Imms 3a866cf202 Refactor escape sequence code and add tests 2016-06-09 18:41:54 -07:00
Daniel Imms e2aaa8d362 Jump over words with ctrl+left/right
Escape codes used: 5=ctrl, C=right, D=left

Fixes #65
2016-06-09 18:01:12 -07:00
runarberg 524db02228 Fix Ctrl/Shift + insert copy/paste
Many systems (including MS Windows and many linuxes) map `<Ctrl>` +
`<Insert>` to copy and `<Shift> + <Insert>` to paste. That serves as a
handy fallback when the more common `<Ctrl> + C` and `<Ctrl> + V`
keybindings have their default prevented to send signals to the
terminal.

Currently all keydown-events with the insert key send `\x1b[2~` to the
terminal. This commit won't send that key if either the `shiftKey` or
the `ctrlKey` are present. Instead it will enable `contentEditable` to
allow for pasting.
2016-06-09 13:45:02 +00:00
Paris Kasidiaris cf9d2348a1 Merge pull request #97 from Tyriar/redundant_resize
Don't resize when unnecessary
2016-06-09 10:53:16 +03:00
Daniel Imms df268ad5cd Fix buffer corruption after resizing rows
Lines from the buffer were incorrectly being removed when the viewport was
resized. This change removes the lines when the cursor is above them, if not it
shifts the viewport down. Some basic jsdoc comments were added to some Terminal
properties for future reference.

Fixes #98
Fixes #99
2016-06-08 19:08:32 -07:00
Daniel Imms e721bdc9f0 Don't resize when unnecessary 2016-06-08 17:38:34 -07:00
Paris Kasidiaris ae99ad83d0 Merge pull request #84 from sourcelair/fix/terminal-focus-event
Fix emission of terminal focus&blur events
2016-06-09 00:00:05 +03:00
Paris 383d59bbc3 Stop marking spans as inline-block (not needed after 670b179140)
Fix #85
2016-06-08 22:03:45 +03:00
TDaglis 6bc1881727 Fix emission of terminal focus&blur events 2016-06-07 13:58:00 +03:00
Paris d82c008052 Make cursor hollow on blur
Fix #79
2016-06-07 10:42:21 +00:00
Paris 670b179140 Set line height of terminal rows to normal
Fix #76
2016-06-07 12:23:28 +03:00
Paris Kasidiaris 180a7af75d Merge pull request #78 from sourcelair/drop-hidden-textarea
Drop hidden textarea for input handling
2016-06-07 09:36:44 +03:00
Paris 8754f8d895 Fix focus and blur events 2016-06-05 03:59:52 +00:00
Paris c02cc84498 Fix cut and copy events
- Do not actually cut on cut
- Strip trailing whitespaces on copy (fix #66)
2016-06-05 06:35:33 +03:00
Paris 647216876b Add a few hacks for better paste handling across browsers 2016-06-03 11:04:46 +03:00
Paris f3bd6145a5 Vanish selection when a key with data is being pressed 2016-06-02 13:31:38 +03:00
Paris 7320515820 Tiny styling update in row line height 2016-06-02 13:08:06 +03:00
Paris 8fa1a46584 Handle the paste event better 2016-06-02 13:05:58 +03:00
Paris fa7d214e78 Remove even more useless code 2016-06-02 12:35:03 +03:00
Paris 178b611b0c Remove useless methods 2016-06-02 12:27:43 +03:00
Daniel Imms ae0f963799 Remove extra whitespace from class names
Use [].join to retain browser compatibility

Fixes #73
2016-06-02 02:17:03 -07:00