-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* pass `uid` to term * term: keep track of term instance references * sessions: remvoe `write` object overhead * hterm: cache measurement of codepoints for single char strings * sessions: merge less eagerly when we receive a PTY_DATA action * store: handle the side effect of writing to the terminal from a middleware * terms: add terms instance cache * lint
- Loading branch information
Showing
9 changed files
with
54 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import terms from '../terms'; | ||
|
||
// the only side effect we perform from middleware | ||
// is to write to the react term instance directly | ||
// to avoid a performance hit | ||
export default () => next => action => { | ||
if (action.type === 'SESSION_PTY_DATA') { | ||
const term = terms[action.uid]; | ||
if (term) { | ||
term.write(action.data); | ||
} | ||
} | ||
next(action); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// react Term components add themselves | ||
// to this object upon mounting / unmounting | ||
// this is to allow imperative access to the | ||
// term API, which is a performance | ||
// optimization for the most common action | ||
// within the system | ||
|
||
const terms = {}; | ||
export default terms; |