Terminus Sublime Text 3



  1. Terminus Sublime Text 3000
  2. Terminus Build
  3. Terminus Shell
  4. Terminal Command Sublime Text 3

Sublime Text 3 is one the best code editors currently in existence (fact), but most people just install it an use it without realising how it can be customized and extended to meet your needs. My aim was to release a series of videos explaining some of these widely unknown capabilities. Sublime Text is one of the most widely used text and source code editors for web and software development. In this tutorial we'll show you how to install Sublime Text 3 on an Ubuntu 18.04 machine.

Browse

Bring a real terminal to Sublime Text

Labelsterminal, shell, bash, zsh, wsl, cmd, powershell

Installs

  • Total107K
  • Win54K
  • Mac25K
  • Linux28K
Apr 25Apr 24Apr 23Apr 22Apr 21Apr 20Apr 19Apr 18Apr 17Apr 16Apr 15Apr 14Apr 13Apr 12Apr 11Apr 10Apr 9Apr 8Apr 7Apr 6Apr 5Apr 4Apr 3Apr 2Apr 1Mar 31Mar 30Mar 29Mar 28Mar 27Mar 26Mar 25Mar 24Mar 23Mar 22Mar 21Mar 20Mar 19Mar 18Mar 17Mar 16Mar 15Mar 14Mar 13Mar 12Mar 11
Windows4880121108109110106988911710711710210988979594125918674831158011010796851061081071091279991891139510989858598103110
Mac20262931443643262935474045333035463032443215273543372637191826474341362116302930233927233430
Linux36354348474839404140454237452138435138293750513347265261373338544742424252454441504830383338

Readme

Source
raw.​githubusercontent.​com

The first cross platform terminal for Sublime Text.

Unix shellCmd.exe
Terminal in panelSupport showing images

This package is heavily inspired by TerminalView. Compare with TerminalView, this has

  • Windows support
  • continuous history
  • easily customizable themes (see Terminus Utilities)
  • unicode support
  • 256 colors support
  • better xterm support
  • terminal panel
  • imgcat support (PS: it also works on Linux / WSL)

Installation

Package Control.

Getting started

  • run Terminus: Open Default Shell in Tab

  • OdatNurd has made several videos on Terminus. See, for examples,

    • https://www.youtube.com/watch?v=etIJMVIvVgg (most up to date)

Terminus Sublime Text 3000

Shell configurations

Terminus comes with several shell configurations. The settings file should be quite self explanatory.

User Key Bindings

You may find these key bindings useful. To edit, run Preferences: Terminus Key Bindings.Check the details for the arguments of terminus_open below.

  • toggle terminal panel
  • open a terminal view at current file directory

or by passing a custom cmd, say ipython

  • open terminal in a split view by using Origami's carry_file_to_pane
  • ctrl-w to close terminal

Following keybinding can be considered if one wants to use ctrl+w to close terminals.

User Commands in Palette

  • run Preferences: Terminus Command Palette. Check the details for the arguments of terminus_open below

or by passing custom cmd, say ipython

  • open terminal in a split tab by using Origami's carry_file_to_pane

Terminus Build System

It is possible to use Terminus as a build system. The target terminus_exec is a drop in replacement of the default target exec. It takes exact same arguments as terminus_open except that their default values are set differently.

Terminus Build

terminus_cancel_build is used to cancel the build when user runs cancel_build triggered by ctrl+c (macOS) or ctrl+break (Windows / Linux).

The following is an example of build system define in project settings that run a python script

Integrated terminal sublime text 3

The same Hello World example could be specified via a .sublime-build file.

Instead of cmd, user could also specify shell_cmd. In macOS and linux, a bash shell will be invoked; and in Windows, cmd.exe will be invoked.

Alt-Left/Right to move between words (Unix)

  • Bash: add the following in .bash_profile or .bashrc

  • Zsh: add the following in .zshrc

Terminus Shell

Some programs, such as julia, do not recognize the standard keycodes for alt+left and alt+right. You couldbind them to alt+b and alt+f respectively“json[ { 'keys”: [“alt+left”], “command”: “terminus_keypress”, “args”: {“key”: “b”, “alt”: true}, “context”: [{“key”: “terminus_view”}] }, { “keys”: [“alt+right”], “command”: “terminus_keypress”, “args”: {“key”: “f”, “alt”: true}, “context”: [{“key”: “terminus_view”}] }]

The fields cmd and cwd understand Sublime Text build system variables.

  • the setting view.settings().get('terminus_view.tag') can be used to identify the terminal and

  • keybind can be binded with specific tagged terminal

  • text can be sent to the terminal with

If tag is not provided or is None, the text will be sent to the first terminal found in the current window.

FAQ

Memory issue

It is known that Terminus sometimes consumes a lot of memory after extensive use. It is because Sublime Text keeps an infinite undo stack. There is virtually no fix unless upstream provides an API to work with the undo stack. Meanwhile, users could execute Terminus: Reset to release the memory.

Color issue when maximizing and minimizing terminal

It is known that the color of the scrollback history will be lost when a terminal is maximized or minimized from or to the panel. There is no fix for this issue.

Terminal panel background issue

If you are using DA UI and your terminal panel has weired background color,try playing with the setting panel_background_color in DA UI: ThemeSettings.

Cmd.exe rendering issue in panel

Due to a upstream bug (may winpty or cmd.exe?), there may be arbitrary empty lines inserted between prompts if the panel is too short. It seems that cmder and powershell are not affected by this bug.

Acknowledgments

Terminal Command Sublime Text 3

This package won't be possible without pyte, pywinpty and ptyprocess.