Terminal for atom, using pty.js & term.js
CoffeeScript CSS
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
keymaps
lib
static
styles
.gitignore
CHANGELOG.md
LICENSE.md
README.md
package.json
roadmap.md

README.md

Termrk

Sliding terminal panel for Atom.

There are various implementations of terminals for Atom; each with their own vision/perspective. The main focus of this one is to have a slick, quickly accessible terminal panel: handy when you need it; out-of-the way when you don't. It slides in and out with a single keystroke, mapped to alt-space by default. Efficient and simple.

  1. Overview
  2. Keybindings
  3. Commands
  4. User-commands
  5. Styling
  6. Credits
  7. License

Overview

Termrk Screenshot

Currently implemented:

  • multiple terminal sessions
  • user defined commands (→ user defined atom-commands)
  • running current file in terminal (supports .js, .node, .coffee, .py and shebang-notation―#!)
  • inserting selection to/from the buffer
  • inserting current file/directory path
  • color/font styling

If some feature that you'd like to see isn't implemented, don't hesitate to create a request.

Demo: running vim inside termrk inside atom

vim demo

⌨ Keybindings

Designed around the alt-space keystroke really. It is often unmapped, and very easy to access.

→ workspace

  • alt-space: toggle terminal panel
  • ctrl-alt-space: create terminal in current file's dir
  • ctrl-alt-shift-space: insert current selection in active terminal

→ inside terminal

  • ctrl-escape: close current terminal
  • ctrl-space: create terminal
  • ctrl-tab: activate next terminal
  • ctrl-shift-tab: activate previous terminal

Note: if a keystroke is catched by an atom-command but you need it inside terminal, add the following code to you keymap.cson.

'.termrk':
  'KEYSTROKE_TO_CATCH': 'native!'

Commands

Name Action Scope Keybinding
termrk:toggle Toggle termrk panel atom-workspace alt-space
termrk:hide Hide termrk panel atom-workspace
termrk:show Show termrk panel atom-workspace
termrk:toggle-focus Toggle focus of termrk panel atom-workspace
termrk:focus Focus termrk panel atom-workspace
termrk:blur Blur termrk panel atom-workspace
termrk:create-terminal Creates new session atom-workspace ctrl-space
termrk:create-terminal-current-dir Creates session in current file's directory atom-workspace ctrl-alt-space
termrk:close-terminal Close active terminal session .termrk ctrl-escape
termrk:insert-selection Inserts current selection in terminal atom-workspace ctrl-alt-sphift-space
termrk:insert-filename Insert current file's path in terminal .termrk
termrk:run-current-file Runs current file in terminal atom-workspace
termrk:create-terminal Creates a terminal-session atom-workspace
termrk:activate-next-terminal Cycles forward terminal-sessions atom-workspace
termrk:activate-previous-terminal Cycles backward terminal-sessions atom-workspace

User-commands

User commands are defined in the file $ATOM_HOME/userCommands.cson. (file path can be configured via Atom Settings)

Commands have this format:

'echofile':
  command: 'echo The current file is $FILE'

The previous command description would be mapped to 'termrk:command-echofile', and calling that command would run 'echo The current file is $FILE' in terminal.

Other examples:

'shellreplace':
  'command': 'gnome-shell --replace --display :0'

'coffeerun':
  'command': 'coffee $FILE'

'npmyes':
  'command': 'cd $DIR && npm init --yes'

# ...

In addition to environment variables, you can also use these:

Name Value
$FILE path of the current file
$DIR directory of the current file
$PROJECT path of the project directory

Styling

(through less/css)

Example for black text on white bg, and blue cursor-bg.

.termrk .terminal {
    color: black;
    background-color: blue;
}

.termrk .terminal-cursor {
    color: black;
    background-color: white;
}

Credits

Termrk is a terminal implementation based on term.js and pty.js modules by Christopher Jeffrey.

Atom is a text-editor developped by github etc. etc....

License

Same as JSON