ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Terminal

by Will Bond (wbond) ALL Top 100

Launch terminals from the current file or the root project folder

Labels terminal

Details

Installs

  • Total 920K
  • Win 501K
  • Mac 219K
  • Linux 200K
Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5 Sep 4 Sep 3 Sep 2 Sep 1 Aug 31 Aug 30 Aug 29 Aug 28 Aug 27 Aug 26 Aug 25 Aug 24
Windows 37 51 44 45 42 57 54 59 60 46 39 47 48 37 51 65 50 49 65 62 60 71 55 39 46 69 59 55 47 41 43 60 52 62 49 44 38 33 44 63 69 68 65 60 48 55
Mac 10 20 10 14 16 17 17 14 22 14 8 12 27 19 22 18 7 13 14 15 22 25 20 17 14 18 21 22 28 20 10 11 7 15 15 19 18 11 13 12 24 20 14 15 12 11
Linux 13 19 11 25 26 28 35 23 12 11 17 19 23 32 25 18 16 19 29 20 37 26 19 22 17 18 22 21 22 19 8 14 21 19 25 20 23 15 20 25 25 23 18 24 21 20

Readme

Source
raw.​githubusercontent.​com

Sublime Terminal

Shortcuts and menu entries for opening a terminal at the current file, or any directory in Sublime Text.

Installation

Download Package Control and use the Package Control: Install Package command from the command palette. Using Package Control ensures Terminal will stay up to date automatically.

Usage

  • Open Terminal at File Opens a terminal in the folder containing the currently opened file.
  • Open Terminal at Project Folder Opens a terminal in the project folder containing the currently opened file.

Terminals can be opened via the command palette, the editor context menu and the sidebar context menus. Additionally, you can set up key bindings.

Key bindings

To create keyboard shortcuts, open the Preferences > Package Settings > Terminal > Key Bindings menu entry. Our suggested key bindings are on the left, you can copy these over to your personal bindings on the right and tweak them to your liking. Example:

[
  { "keys": ["super+shift+t"], "command": "open_terminal" },
  { "keys": ["super+shift+alt+t"], "command": "open_terminal_project_folder" }
]

Note that in version 2 of this package, we stopped enabling these bindings by default. They conflicted with built-in bindings of Sublime Text, and users might have different preferences.

Package Settings

The settings can be viewed and edited by accessing the Preferences > Package Settings > Terminal > Settings menu entry.

  • terminal
    • The terminal to execute, will default to the OS default if blank.
    • Default: ""
  • parameters
    • The parameters to pass to the terminal. These parameters will be used if no custom parameters are passed.
    • Default: []
  • env
    • The environment variables changeset. Default environment variables used when invoking the terminal are inherited from Sublime Text.
    • The changeset may be used to overwrite/unset environment variables. Use null to indicate that the environment variable should be unset.
    • Default: {}

Custom Parameters

By passing parameters argument to the open_terminal or open_terminal_project_folder commands, it is possible to construct custom terminal environments. You can do so by creating custom key bindings that call these commands with the arguments you want, as we'll document here, or by adding custom command palette or menu entries.

The following is an example, of passing the parameters -T 'Custom Window Title' to an XFCE terminal.

{
 "keys": ["ctrl+alt+t"],
 "command": "open_terminal",
 "args": {
   "parameters": ["-T", "Custom Window Title"]
 }
}

A parameter may also contain the %CWD% placeholder, which will be substituted with the current working directory the terminal was opened to.

{
 "keys": ["ctrl+alt+t"],
 "command": "open_terminal",
 "args": {
   "parameters": ["-T", "Working in directory %CWD%"]
 }
}

Example configurations

Here are some example configurations calling different terminals. Note that paths to executables might differ on your machine.

Cmder on Windows

{
  "terminal": "C:\\Program Files\\cmder_mini\\cmder.exe",
  "parameters": ["/START", "%CWD%"]
}

xterm on GNU/Linux

{
  "terminal": "xterm"
}

gnome-terminal for CJK users on GNU/Linux

We unset LD_PRELOAD, as it may cause problems for Sublime Text with imfix.

{
  "terminal": "gnome-terminal",
  "env": {"LD_PRELOAD": null}
}

iTerm on MacOS.

{
  "terminal": "iTerm.sh"
}

iTerm on MacOS. with tabs

{
  "terminal": "iTerm.sh",
  "parameters": ["--open-in-tab"]
}

iTerm2 v3 on MacOS.

{
  "terminal": "iTerm2-v3.sh"
}

Hyper on MacOS.

{
  "terminal": "hyper.sh"
}

Kitty on OS X

{
  "terminal": "/opt/homebrew/bin/kitty",
  "parameters": ["-d", "%CWD%"]
}

Windows Terminal

{
  "terminal": "C:/Users/yourusername/AppData/Local/Microsoft/WindowsApps/wt.exe",
  "parameters": ["-d", "."]
}