Shortcuts and menu entries for opening a terminal at the current file, or any directory in Sublime Text.
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.
- Open Terminal at File Press Alt+Shift+T on Windows, Linux, or macOS.
- Open Terminal at Project Folder Press Ctrl+Alt+Shift+T on Windows, Linux, or macOS.
In addition to the key bindings, terminals can also be opened via the editor context menu and the sidebar context menus.
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:
{}
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%"]
}
}
Here are some example configurations calling different terminals. Note that paths to executables might differ on your machine.
{
"terminal": "C:\\Program Files\\cmder_mini\\cmder.exe",
"parameters": ["/START", "%CWD%"]
}
{
"terminal": "xterm"
}
We unset LD_PRELOAD, as it may cause problems for Sublime Text with imfix.
{
"terminal": "gnome-terminal",
"env": {"LD_PRELOAD": null}
}
{
"terminal": "iTerm.sh"
}
{
"terminal": "iTerm.sh",
"parameters": ["--open-in-tab"]
}
{
"terminal": "iTerm2-v3.sh"
}
{
"terminal": "hyper.sh"
}
{
"terminal": "/opt/homebrew/bin/kitty",
"parameters": ["-d", "%CWD%"]
}
{
"terminal": "C:/Users/yourusername/AppData/Local/Microsoft/WindowsApps/wt.exe",
"parameters": ["-d", "."]
}