tty.js icon indicating copy to clipboard operation
tty.js copied to clipboard

Lightweight terminal

Open cbou opened this issue 12 years ago • 10 comments

It would be nice to have an example without all the Windows and Tab stuff.

Just one terminal which fit his html container.

It would be easier to embed tty.js in a Web-App.

index.html is a nice presentation but it's a too complicated example.

Do you have some examples in this way ?

cbou avatar May 04 '12 11:05 cbou

that would be awesome, +1

fbstj avatar May 04 '12 12:05 fbstj

Good idea. I have some simple tests that benchmark the terminal inside the browser. That's pretty much all it is, just a single terminal on a single page. I've really been meaning to add it to the repo for a while.

I've also been thinking of moving static/term.js to a separate repo, but at the same time, it is the heart and soul of tty.js, so it should probably stay.

chjj avatar May 04 '12 17:05 chjj

I also think that client side and server side are too closed to separate them. I would be nice if you can push this small test.

cbou avatar May 05 '12 10:05 cbou

I second this request, it would be nice to have a simple single terminal per chrome window.

treeform avatar Jul 04 '12 17:07 treeform

totally agree that this would be great +1.

jem avatar Aug 29 '12 22:08 jem

:+1:

aeosynth avatar Oct 09 '12 05:10 aeosynth

I've been wanting this also - preferrably size-aware, so that it sizes the terminal to frame size... i.e. something like:

window.onresize = function ()  {                                                                                                                                     
    windowSize();  
    /* resize terminal code here */                                                                                                                                                  
     }

function windowSize() {                                                                                                                                             
  if( typeof( window.innerWidth ) == 'number' ) {                                                                                                                   
    //Non-IE                                                                                                                                                        
    myWidth = window.innerWidth;                                                                                                                                    
    myHeight = window.innerHeight;                                                                                                                                  
  } else if( document.documentElement && (                                                                                                                          
  document.documentElement.clientWidth ||                                                                                                                           
  document.documentElement.clientHeight ) ) {                                                                                                                       
    //IE 6+ in 'standards compliant mode'                                                                                                                           
    myWidth = document.documentElement.clientWidth;                                                                                                                 
    myHeight = document.documentElement.clientHeight;                                                                                                               
  } else if( document.body && ( document.body.clientWidth ||                                                                                                        
  document.body.clientHeight ) ) {                                                                                                                                  
    //IE 4 compatible                                                                                                                                               
    myWidth = document.body.clientWidth;                                                                                                                            
    myHeight = document.body.clientHeight;                                                                                                                          
  }                                                                                                                                                                 
}                     

risacher avatar Nov 01 '12 16:11 risacher

@risacher, yeah, that's not a bad idea either. Maybe we could just make it full screen anyway.

Kind of a late announcement, but to everyone else who posted in this thread, there is an example available of a simple terminal: https://github.com/chjj/tty.js/tree/master/example

chjj avatar Nov 01 '12 16:11 chjj

I want this also +1

nmg1986 avatar Oct 29 '14 10:10 nmg1986

:+1: Would be great to just open a page in a browser and start cracking away.

On a side note... It would also be nice to be able to place buttons below the window which act as "Macros"... Say a "build" button that just drops a command into the tty and runs it.

howardroark avatar Jun 15 '15 16:06 howardroark