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

Add term.js support #47

Closed
wants to merge 2 commits into from
Closed

Add term.js support #47

wants to merge 2 commits into from

Conversation

ysangkok
Copy link
Collaborator

@ysangkok ysangkok commented Jan 9, 2015

This PR addresses issue #46.

term.js has better support for scrollback and escape sequences. The old terminal is still supported. By defining either termid or termel as a jor1k parameter, it will use the old terminal or term.js, respectively.

Caveats:

  • This patch does not provide clipboard support yet, but it can't be very hard. Maybe I'll get it working soon. I fixed this.
  • The terminal interprets inputted UTF-8 as ISO-8859-1 when it is echoed back. This is unintuitive. I believe this may not be a bug with the terminal emulator, but maybe because of lacking terminfo.

@s-macke
Copy link
Owner

s-macke commented Jan 9, 2015

ncurses is compiled with linux, xterm and xterm-256colors support.

The .profile file sets the terminal to linux, which is the simplest one.
try "export TERM=xterm"

@s-macke
Copy link
Owner

s-macke commented Jan 9, 2015

The problem with this pull request is, that it bloats the whole source. This is reason, why I didn't want to implement it this way.
I think of something more like

<script src="jor1k-min.js"/>
<script src="plugins/terminals/term.js"/>

<script>
    var term = new jor1k.plugins.term(canvasid);
    jor1k.SetTerminal(term);
</script>

Not necessary exactly this way. Just, that you get an idea.

@gbraad
Copy link
Collaborator

gbraad commented Jan 9, 2015

First of all, the dependency should be pulled in by either npm or bower
instead of included into the archive. This could prevent some of the bloat.

On Fri, Jan 9, 2015 at 4:43 PM, Sebastian Macke notifications@github.com
wrote:

The problem with this pull request is, that it bloats the whole source.
This is reason, why I didn't want to implement it this way.

I think of something more like

Not necessary exactly this way. Just, that you get an idea.


Reply to this email directly or view it on GitHub
#47 (comment).

Gerard Braad — 吉拉德
F/OSS & IT Consultant in Beijing
http://gbraad.nl gpg: 0x592CFE75

@regular
Copy link
Contributor

regular commented Jan 9, 2015

I agree with @gbraad.
This is a good example of the benefits of using browserify and npm.
The real problem is jor1k's API: If, instead of accepting a dom id for the terminal, jor1k would accept an actual terminal object, that implements a certain interface, system integrators would be able to choose whatever terminal implementation they like.

Example:

package.json

{
  name: 'my awesome joe1k-based emulator',
  dependencies: {
    'jor1k', 'termjs'  
  }
}

index.js

Termjs = require('term.js');
Jor1k = require('jor1k');

term = new Termjs('terminalid');
jor1k = new Jor1k({terminal: term});

The interface of the terminal object should be based on Node-style streams. (see substack's document)

@ysangkok
Copy link
Collaborator Author

ysangkok commented Jan 9, 2015

I addressed your concerns, check out PR #48 .

@ysangkok ysangkok closed this Jan 9, 2015
@ysangkok ysangkok deleted the term.js-support branch January 9, 2015 17:14
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.

None yet

4 participants