Skip to content


Subversion checkout URL

You can clone with
Download ZIP
A Graphical Terminal Interface that extends xterm by adding GUI-like features and session sharing
JavaScript Python CSS Shell R IDL

This branch is even with gh-pages

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

<html xmlns="">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>README &mdash; GraphTerm 0.57.0 documentation</title>
    <link rel="stylesheet" href="_static/sphinxdoc.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <script type="text/javascript">
        URL_ROOT:    './',
        VERSION:     '0.57.0',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="search" type="application/opensearchdescription+xml"
          title="Search within GraphTerm 0.57.0 documentation"
    <link rel="top" title="GraphTerm 0.57.0 documentation" href="index.html" />
    <link rel="next" title="Getting started" href="start.html" />
    <link rel="prev" title="Contact" href="contact.html" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<style type="text/css">
  table.right { float: right; margin-left: 20px; }
  table.right td { border: 1px solid #ccc; }
<script type="text/javascript">
// Google Analytics setup
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-35342722-1']);

function goApp() {
   if (window.navigator.standalone) {
      // Go home
      location.href = "/";
   } else {
      // Go to top level domain
      var url = location.protocol + "//" + location.hostname.split(".").slice(-2).join(".");
      if (location.port)
        url += ":" + location.port;
      location.href = url;

// Prevent internal links in iOS standalone web apps from opening in browser
(function(document,navigator,standalone) {
            // prevents links from apps from oppening in mobile safari
            // this javascript must be the first script in your <head>
            if ((standalone in navigator) && navigator[standalone]) {
                var curnode, location=document.location, stop=/^(a|html)$/i;
                document.addEventListener('click', function(e) {
                    while (!(stop).test(curnode.nodeName)) {
                    // Conditions to do this only on links to your own app
                    if ('href' in curnode) {
                        location.href = curnode.href;


<div style="background-color: white; text-align: left; padding: 10px 10px 15px 15px">
<a href="/">
<img height="60" src="" alt="Mindmeldr banner" />
</a>/<a href="/graphterm">graphterm</a>

    <div class="related">
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
        <li class="right" >
          <a href="start.html" title="Getting started"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="contact.html" title="Contact"
             accesskey="P">previous</a> |</li>
        <li><a href="index.html">Docs Home</a>&nbsp;|&nbsp;</li>
        <li><a href="contents.html">Contents</a>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="contents.html">Table Of Contents</a></h3>
<li><a class="reference internal" href="#">README</a><ul>
<li><a class="reference internal" href="#introduction">Introduction</a></li>
<li><a class="reference internal" href="#installation">Installation</a></li>
<li><a class="reference internal" href="#quick-start">Quick Start</a></li>
<li><a class="reference internal" href="#documentation-and-support">Documentation and Support</a></li>
<li><a class="reference internal" href="#caveats-and-limitations">Caveats and Limitations</a></li>
<li><a class="reference internal" href="#credits">Credits</a></li>
<li><a class="reference internal" href="#license">License</a></li>

  <h4>Previous topic</h4>
  <p class="topless"><a href="contact.html"
                        title="previous chapter">Contact</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="start.html"
                        title="next chapter">Getting started</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="_sources/README.txt"
           rel="nofollow">Show Source</a></li>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
<script type="text/javascript">$('#searchbox').show(0);</script>

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
  <div class="section" id="readme">
<span id="id1"></span><h1><a class="toc-backref" href="#id7">README</a><a class="headerlink" href="#readme" title="Permalink to this headline">¶</a></h1>
<div class="contents topic" id="contents">
<p class="topic-title first">Contents</p>
<ul class="simple">
<li><a class="reference internal" href="#readme" id="id7">README</a><ul>
<li><a class="reference internal" href="#introduction" id="id8">Introduction</a></li>
<li><a class="reference internal" href="#installation" id="id9">Installation</a></li>
<li><a class="reference internal" href="#quick-start" id="id10">Quick Start</a></li>
<li><a class="reference internal" href="#documentation-and-support" id="id11">Documentation and Support</a></li>
<li><a class="reference internal" href="#caveats-and-limitations" id="id12">Caveats and Limitations</a></li>
<li><a class="reference internal" href="#credits" id="id13">Credits</a></li>
<li><a class="reference internal" href="#license" id="id14">License</a></li>
<div class="section" id="introduction">
<h2><a class="toc-backref" href="#id8">Introduction</a><a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h2>
<p><tt class="docutils literal"><span class="pre">GraphTerm</span></tt> is a browser-based graphical terminal interface, that
aims to seamlessly blend the command line and graphical user
interfaces. You can use it just like a regular terminal,
backwards-compatible with <tt class="docutils literal"><span class="pre">xterm</span></tt>, and access the additional
graphical features as needed. These features can help impove your
terminal workflow by integrating graphical operations with the
command line and letting you view images and HTML output inline.</p>
<p>GraphTerm has several funky features, but two of the most useful
practical applications are:</p>
<div><ul class="simple">
<li>an <strong>inline data visualization tool</strong> for plotting with Python or R
that can work seamlessly across SSH login
boundaries, with an optional notebook interface. (For remote
access, it also serves as a detachable terminal, like
<tt class="docutils literal"><span class="pre">tmux</span></tt> or <tt class="docutils literal"><span class="pre">screen</span></tt>.)</li>
<li>a <a class="reference external" href="">virtual computer lab</a> for teaching and demonstrations. The
GraphTerm server can be set up in the cloud and accessed by
multiple users using their laptop/mobile browsers, with Google
Authentication. The lab instructor can
<a class="reference external" href="">monitor all the users&#8217;  terminals</a>
via a &#8220;dashboard&#8221;, and users can collaborate with each other by
sharing terminals and notebooks.</li>
<p><strong>Screenshot 1: Inline plotting on a remote machine (via SSH)</strong></p>
<div class="figure align-center" style="width: 85%">
<a class="reference internal image-reference" href=""><img alt="" src="" style="width: 90%;" /></a>
<hr style="margin-bottom: 3em;"><blockquote>
<div><strong>Screenshot 2: Monitoring multiple user terminals in a &#8220;virtual computer lab&#8221;</strong></div></blockquote>
<div class="figure align-center" style="width: 85%">
<a class="reference internal image-reference" href=""><img alt="" src="" style="width: 90%;" /></a>
<p>GraphTerm builds upon two earlier projects,
<a class="reference external" href="">XMLTerm</a>
which implemented a terminal using the Mozilla framework and
<a class="reference external" href="">AjaxTerm</a>
which is an AJAX/Python terminal implementation. (Other recent
projects along these lines include  <a class="reference external" href="">TermKit</a>
and <a class="reference external" href="">Terminology</a>.)</p>
<p>A GraphTerm terminal window is just a web page served from the
GraphTerm server program. Multiple users can connect
simultaneously to the web server to share terminal sessions.
Multiple hosts can also connect to the server (on a different port),
allowing a single user to access all of them via the browser.
The GraphTerm server acts as a <em>router</em>, sending input from browser
windows for different users to the appropriate terminal (pseudo-tty)
sessions running on different hosts, and transmitting the
terminal output back to the browser windows.</p>
<p>The interface is designed to be touch-friendly for use with
tablets, with tappable links and command re-use to minimize the need for
a keyboard. It preserves history for all commands,
whether entered by typing, clicking, or tapping.
It is also themable using CSS.</p>
<p>You can use the GraphTerm API to build &#8220;mashups&#8221; of web applications
that work seamlessly within the terminal.  Sample mashups include:</p>
<div><ul class="simple">
<li><tt class="docutils literal"><span class="pre">greveal</span></tt>: Inline version of <tt class="docutils literal"><span class="pre">reveal.js</span></tt> to display Markdown files as slideshows</li>
<li><tt class="docutils literal"><span class="pre">gtutor</span></tt>: Inline version of <a class="reference external" href=""></a> for visual tracing of python programs</li>
<li><tt class="docutils literal"><span class="pre">yweather</span></tt>: Using Yahoo weather API to display weather</li>
<p>Images of GraphTerm in action can be found in <a class="reference external" href="">screenshots</a>
and in this <a class="reference external" href="">YouTube Video</a>.
Here is a sample screenshot showing the output of the
<a class="reference external" href=""></a>
command, which embeds six smaller terminals within the main terminal, running
six different commands from the GraphTerm toolchain: (i) live twitter stream output using
<tt class="docutils literal"><span class="pre">gtweet</span></tt>, (ii) weather info using <tt class="docutils literal"><span class="pre">yweather</span></tt>,
(ii) slideshow from markdown file using <tt class="docutils literal"><span class="pre">greveal</span></tt> and <em>reveal.js</em>,
(iv) word cloud using <tt class="docutils literal"><span class="pre">d3cloud</span></tt> and <em>d3.js</em>, (v) inline graphics using <tt class="docutils literal"><span class="pre"></span></tt>,
and (vi) notebook mode using the standard python interpreter.</p>
<div><strong>Screenshot 3: Embedding terminals within GraphTerm</strong></div></blockquote>
<div class="figure align-center" style="width: 100%">
<a class="reference internal image-reference" href=""><img alt="" src="" style="width: 90%;" /></a>
<div class="section" id="installation">
<span id="id2"></span><h2><a class="toc-backref" href="#id9">Installation</a><a class="headerlink" href="#installation" title="Permalink to this headline">¶</a></h2>
<p>To install <tt class="docutils literal"><span class="pre">GraphTerm</span></tt>, you need to have Python 2.6+ and the Bash
shell on your Mac/Linux/Unix computer. For a quick install, use one of
the following two options:</p>
<div class="highlight-python"><div class="highlight"><pre>sudo pip install graphterm
sudo easy_install graphterm; sudo gterm_setup
<p>If you wish to install GraphTerm as a non-root user within an Anaconda
or Enthought Python environment, you can omit the <tt class="docutils literal"><span class="pre">sudo</span></tt> prefix.</p>
<p>For a manual install procedure, download the release tarball from the
<a class="reference external" href="">Python Package Index</a>, untar,
and execute the following command in the <tt class="docutils literal"><span class="pre">graphterm-&lt;version&gt;</span></tt> directory:</p>
<div class="highlight-python"><div class="highlight"><pre>python install
<p>For the manual install, you will also need to install the <tt class="docutils literal"><span class="pre">tornado</span></tt>
web server, which can be downloaded from
<a class="reference external" href=""></a></p>
<p>You can also try out GraphTerm without installing it, by untarring the
source tarball (or checking out the source from <tt class="docutils literal"><span class="pre">github</span></tt>). You can
run the server as <tt class="docutils literal"><span class="pre">./</span></tt> within the <tt class="docutils literal"><span class="pre">graphterm</span></tt>
subdirectory of the distribution, after you have installed the
<tt class="docutils literal"><span class="pre">tornado</span></tt> package on your system (or within the <tt class="docutils literal"><span class="pre">graphterm</span></tt>
subdirectory of the source distribution). In this case, certain
commands in the <tt class="docutils literal"><span class="pre">graphterm/bin</span></tt> subdirectory, such as <tt class="docutils literal"><span class="pre">gterm</span></tt> and
<tt class="docutils literal"><span class="pre">gauth</span></tt>, would need to be accessed as <tt class="docutils literal"><span class="pre"></span></tt> and <tt class="docutils literal"><span class="pre"></span></tt> respectively.</p>
<p>You can browse the <tt class="docutils literal"><span class="pre">GraphTerm</span></tt> source code, and download the development
version, at <a class="reference external" href="">Github</a>.</p>
<div class="section" id="quick-start">
<h2><a class="toc-backref" href="#id10">Quick Start</a><a class="headerlink" href="#quick-start" title="Permalink to this headline">¶</a></h2>
<p>To start the <tt class="docutils literal"><span class="pre">GraphTerm</span></tt> server, use the command:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">gtermserver</span> <span class="o">--</span><span class="n">terminal</span> <span class="o">--</span><span class="n">auth_type</span><span class="o">=</span><span class="n">none</span>
<p>This will run the  server and open a GraphTerm terminal window
using the default browser. For multi-user computers,
omit the <tt class="docutils literal"><span class="pre">--auth_type=none</span></tt> option
when starting the server, and enter the authentication code stored in
the file <tt class="docutils literal"><span class="pre">~/.graphterm/_gterm_auth.txt</span></tt> as needed. (The <tt class="docutils literal"><span class="pre">gterm</span></tt>
command can automatically enter this code for you.)</p>
<p>You can access the GraphTerm server using any browser that supports
websockets. Google Chrome works best, but Firefox, Safari, or IE10
are also supported. Start by entering the following URL:</p>
<div class="highlight-python"><div class="highlight"><pre>http://localhost:8900
<p>In the <tt class="docutils literal"><span class="pre">graphterm</span></tt> browser page, select the GraphTerm host you
wish to connect to and create a new terminal session. (Note: The GraphTerm
host is different from the network hostname for the server.)
Within a GraphTerm window, you can use <em>terminal/new</em> menu option, or
type the command <tt class="docutils literal"><span class="pre">gmenu</span> <span class="pre">new</span></tt>, to create a new GraphTerm session</p>
<p>You can also open additional GraphTerm terminal windows using
the <tt class="docutils literal"><span class="pre">gterm</span></tt> command:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">gterm</span> <span class="o">--</span><span class="n">noauth</span> <span class="p">[</span><span class="n">session_name</span><span class="p">]</span>
<p>where the terminal session name argument is optional.</p>
<p>Once you have a terminal, try out the following commands:</p>
<div class="highlight-python"><div class="highlight"><pre>gls &lt;directory&gt;
gvi &lt;text-filename&gt;
<p>These are commands in the GraphTerm toolchain that imitate
basic features of the standard <tt class="docutils literal"><span class="pre">ls</span></tt> and <tt class="docutils literal"><span class="pre">vi</span></tt> commands.
(<em>Note:</em> You need to execute the <tt class="docutils literal"><span class="pre">sudo</span> <span class="pre">gterm_setup</span></tt> command
to be able to use the GraphTerm toolchain. Otherwise, you will
encounter a <tt class="docutils literal"><span class="pre">Permission</span> <span class="pre">denied</span></tt> error.)
See <a class="reference external" href="">Getting Started with GraphTerm</a>
for more info on using GraphTerm. You can also
<a class="reference external" href="">set up a virtual computer lab</a>
using GraphTerm.</p>
<div class="section" id="documentation-and-support">
<h2><a class="toc-backref" href="#id11">Documentation and Support</a><a class="headerlink" href="#documentation-and-support" title="Permalink to this headline">¶</a></h2>
<p>Usage info and other documentation can be found on the project home page,
<a class="reference external" href=""></a>.
See the <a class="reference external" href="">Contents</a>
page for an overview of the documentation and the
<a class="reference external" href="">Talks and Tutorials</a>
page for more advanced usage examples.</p>
<p>You can also use the following command:</p>
<div class="highlight-python"><div class="highlight"><pre>greveal $GTERM_DIR/bin/landslide/ | gframe -f
<p>to view a slideshow about GraphTerm within GraphTerm.
Click on the red X in the top right corner to exit the slideshow.</p>
<p>There is a <a class="reference external" href="">Google Groups mailing list</a>
for announcements of new releases, posting questions related to
GraphTerm etc. You can also follow <a class="reference external" href="">&#64;graphterm</a> on Twitter for updates.</p>
<p>To report bugs and other issues, use the Github <a class="reference external" href="">Issue Tracker</a>.</p>
<div class="section" id="caveats-and-limitations">
<h2><a class="toc-backref" href="#id12">Caveats and Limitations</a><a class="headerlink" href="#caveats-and-limitations" title="Permalink to this headline">¶</a></h2>
<li><p class="first"><em>Reliability:</em>  This software has not been subject to extensive testing. Use at your own risk.</p>
<li><dl class="first docutils">
<dt><em>Platforms:</em> The <tt class="docutils literal"><span class="pre">GraphTerm</span></tt> client should work on most recent</dt>
<dd><p class="first last">browsers that support Websockets, such as Google Chrome, Firefox,
and Safari. (Google Chrome usually works best.) The <tt class="docutils literal"><span class="pre">GraphTerm</span></tt>
server is pure-python, but with some OS-specific calls for file,
shell, and terminal-related operations. It has been tested only on
Linux and Mac OS X so far.</p>
<li><dl class="first docutils">
<dt><em>Current limitations:</em></dt>
<dd><ul class="first last simple">
<li>Support for <tt class="docutils literal"><span class="pre">xterm</span></tt> escape sequences is incomplete.</li>
<li>Most features of GraphTerm only work with the bash shell, not with C-shell, due the need for PROMPT_COMMAND to keep track of the current working directory.</li>
<li>At the moment, you cannot customize the shell prompt. (You
should be able to so in the future.)</li>
<div class="section" id="credits">
<h2><a class="toc-backref" href="#id13">Credits</a><a class="headerlink" href="#credits" title="Permalink to this headline">¶</a></h2>
<p><tt class="docutils literal"><span class="pre">GraphTerm</span></tt> is inspired by two earlier projects that implement the
terminal interface within the browser,
<a class="reference external" href="">XMLTerm</a> and
<a class="reference external" href="">AjaxTerm</a>.
It borrows many of the ideas from <em>XMLTerm</em> and re-uses chunks of code from
<em>AjaxTerm</em>. The server uses the asynchronous <a class="reference external" href="">Tornado web framework</a> and the client uses <a class="reference external" href="">jQuery</a>.</p>
<p>The <tt class="docutils literal"><span class="pre">gls</span></tt> command uses icons from the <a class="reference external" href="">Tango Icon Library</a>, and graphical editing uses the
<a class="reference external" href=""> Cloud9 Editor</a> as well as
<a class="reference external" href="">CKEditor</a></p>
<p>The 3D perspective mode was inspired by Sean Slinsky&#8217;s <a class="reference external" href="">Star Wars
Opening Crawl with CSS3</a>.</p>
<p>Other packaged open source components include:</p>
<div><ul class="simple">
<li><a class="reference external" href="">d3.js</a>  Data driven documents</li>
<li><a class="reference external" href="">Landslide</a> presentation
<li>Online Python Tutorial from <a class="reference external" href=""></a></li>
<li><a class="reference external" href="">Pagedown</a> Javascript
Markdown converter</li>
<li><a class="reference external" href="">Superfish</a>
menu plugin</li>
<li><a class="reference external" href="">underscore.js</a> utility library</li>
<p><tt class="docutils literal"><span class="pre">GraphTerm</span></tt> was developed as part of the <a class="reference external" href="">Mindmeldr</a> project, which is aimed at improving classroom interaction.</p>
<div class="section" id="license">
<h2><a class="toc-backref" href="#id14">License</a><a class="headerlink" href="#license" title="Permalink to this headline">¶</a></h2>
<p><tt class="docutils literal"><span class="pre">GraphTerm</span></tt> is distributed as open source under the <a class="reference external" href="">BSD-license</a>.</p>

      <div class="clearer"></div>
    <div class="related">
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
        <li class="right" >
          <a href="start.html" title="Getting started"
             >next</a> |</li>
        <li class="right" >
          <a href="contact.html" title="Contact"
             >previous</a> |</li>
        <li><a href="index.html">Docs Home</a>&nbsp;|&nbsp;</li>
        <li><a href="contents.html">Contents</a>

    <div class="footer">
        &copy; Copyright 2012-2014 R. Saravanan.
      Created using <a href="">Sphinx</a> 1.2.2.
<div class="footer">
<script type="text/javascript">
  (function() {
    var ga = document.createElement('script');
    ga.src = ('https:' == document.location.protocol ?
              'https://ssl' : 'http://www') + '';
    ga.setAttribute('async', 'true');

Something went wrong with that request. Please try again.