Shortcuts and menu entries for opening a terminal at the current file, or the current root project folder 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.
In addition to the key bindings, terminals can also be opened via the editor context menu and the sidebar context menus.
The default settings can be viewed by accessing the Preferences > Package Settings > Terminal > Settings – Default menu entry. To ensure settings are not lost when the package is upgraded, make sure all edits are saved to Settings – User.
null
to indicate that the environment variable should be unset.Here are some example setups:
{
// Replace with your own path to cmder.exe
"terminal": "C:\\Program Files\\cmder_mini\\cmder.exe",
"parameters": ["/START", "%CWD%"]
}
{
"terminal": "xterm"
}
{
"terminal": "gnome-terminal",
// Unset LD_PRELOAD which may cause problems for sublime with imfix
"env": {"LD_PRELOAD": null}
}
{
"terminal": "iTerm.sh"
}
{
"terminal": "iTerm.sh",
"parameters": ["--open-in-tab"]
}
{
"terminal": "iTerm2-v3.sh"
}
{
"terminal": "hyper.sh"
}
{
"terminal": "C:/Users/yourusername/AppData/Local/Microsoft/WindowsApps/wt.exe",
"parameters": ["-d", "."]
}
With the parameters argument to the open_terminal and open_terminal_project_folder commands, it is possible to construct custom terminal environments.
The following is an example of passing the parameters -T 'Custom Window Title' to a terminal. Please note that this example is just an example, and is tailored to the XFCE terminal application. Your terminal may use the -T
option for some other features or setting. Custom key bindings such as this would be added to the file opened when accessing the Preferences > Key Bindings – User menu entry (the file name varies by operating system).
{
"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%"]
}
}