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 905K
  • Win 492K
  • Mac 216K
  • Linux 196K
Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10 Mar 9 Mar 8 Mar 7 Mar 6 Mar 5 Mar 4 Mar 3 Mar 2 Mar 1 Feb 29 Feb 28 Feb 27 Feb 26 Feb 25 Feb 24 Feb 23 Feb 22 Feb 21 Feb 20 Feb 19 Feb 18 Feb 17 Feb 16 Feb 15 Feb 14 Feb 13 Feb 12 Feb 11 Feb 10 Feb 9 Feb 8 Feb 7 Feb 6 Feb 5 Feb 4 Feb 3
Windows 9 54 43 46 56 68 50 63 63 50 45 62 73 83 57 65 64 57 62 68 62 71 66 40 64 60 63 80 65 68 45 54 65 72 48 53 61 48 57 46 66 55 51 46 59 54
Mac 2 23 15 15 19 28 20 21 26 7 14 13 22 18 18 23 11 12 24 22 29 21 16 11 8 26 23 37 23 14 21 17 15 26 12 12 22 12 11 24 26 19 19 24 19 14
Linux 2 21 21 16 24 28 20 22 36 22 18 23 19 25 22 25 21 30 18 25 21 26 30 28 28 28 27 28 15 19 23 23 21 30 21 20 22 26 21 23 29 29 19 21 24 18

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", "."]
}