The terminal is supported natively out of the box in Visual Studio code.

Sublime has no support for terminal inbuilt-in.

You can extend using plugin packages.

Terminal used to run and compile code using the command line.

The sublime editor has a Terminal package that needs to be installed to run the command line.

How to open the command line in Sublime text editor?

The following are the steps required to install Terminal.

  • Open Sublime text editor
  • First Make sure that the package control plugin is installed in your editor. You can check here how to do it.
  • Once package control is installed, Go to the next step
  • Select Tools Menu + Command palette or use short cut CTRL+ Shift+P in windows or ⌘ +Shift+H command in macOS .

It opens a popup dialog as shown below.

Sublime text package control installation

  • type install and select Package Control: install package

  • Sublime text package control  install package

  • type Terminal in the package list as given below and select HTML-CSS-JS Prettify package

Sublime text install terminal package

It installs the terminal package, and the message shows in the bottom left status bar.

  • Right-click on either a file in the left sidebar or an opened file and select Open Terminal Here as shown below

Sublime text open termial

  • It opens the PowerShell command-line terminal in a new window.
  • It opened PowerShell with the selected file directory.

Open the Command line terminal instead of PowerShell in Sublime text editor.

  • Go To Preferences > package settings > Terminal - Settings - Default
  • You can check the given screenshot for more

Sublime text terminal settings

  • It opens the Terminal.sublime.settings file and It contains the following json content
{
    // The command to execute for the terminal, leave blank for the OS default
    // See https://github.com/wbond/sublime_terminal#examples for examples
    "terminal": "",

    // A list of default parameters to pass to the terminal, this can be
    // overridden by passing the "parameters" key with a list value to the args
    // dict when calling the "open_terminal" or "open_terminal_project_folder"
    // commands
    "parameters": [],

    // An environment variables changeset. Default environment variables used for the
    // terminal are inherited from sublime. Use this mapping to overwrite/unset. Use
    // null value to indicate that the environment variable should be unset.
    "env": {}
}
  • Update the terminal and parameters properties values to below
"terminal": "C:\\Windows\\system32\\cmd.exe",
"parameters": ["/START", "%CWD%"]
  • Right-click on any file and select the Open Terminal Here option
  • It opens the command window in place of the PowerShell window.

Shortcut command to run the terminal in Sublime text

As of now, we have seen how to run the command line from GUI.

You can also open the terminal with a command shortcut.

You have to do custom keybinding attached to the terminal.

  • Go To Preferences Menu > Key Bindings
  • It opens Default (Windows).sublime-keymap file
  • update the below content.
{ "keys": ["ctrl+t"], "command": "cmd"}
  • now, you can ctrl+t command shortcut to open the command line window. You can use any keys you want